Servuz Burkhard ,viele dank und kein Problem, (ich wohne in Oesterreich
)
That looks difficult :o , so this part is the code which takes the data from the sensor and insert it in the tile from danfoss:
[code]-- list of { temperature_sensor_device_id, { list of Danfoss_LC_device_id } }
devices_to_synchronize = { { 167, { 218 } }, – B
{ 162, { 221 } }, – KiZ
{ 169, { 211 } }, – SZ
{ 170, { 94, 107 } } } – WZS, WZN
function synchronize_temp( lul_device, lul_service, lul_variable, lul_value_old, lul_value_new )
for i = 1,#devices_to_synchronize
do
if devices_to_synchronize[ i ][ 1 ] == tonumber( lul_device )
then
for j = 1,#devices_to_synchronize[ i ][ 2 ]
do
luup.variable_set( 'urn:upnp-org:serviceId:TemperatureSensor1', 'CurrentTemperature', lul_value_new, devices_to_synchronize[ i ][ 2 ][ j ] )
end
end
end
end – synchronize_temp
for i = 1,#devices_to_synchronize
do
luup.variable_watch( ‘synchronize_temp’, ‘urn:upnp-org:serviceId:TemperatureSensor1’, ‘CurrentTemperature’, devices_to_synchronize[ i ][ 1 ] )
end[/code]
If I understand correctly , this is the part I need to change:
{ { 167, { 218 } }, -- B
{ 162, { 221 } }, -- KiZ
{ 169, { 211 } }, -- SZ
{ 170, { 94, 107 } } } -- WZS, WZN
I have 1 danfoss in my living room , ID Device #138 and the ID for the temp sensor is Device #189
Is this than correct:
[code]-- list of { temperature_sensor_device_id, { list of Danfoss_LC_device_id } }
devices_to_synchronize = { { 138, { 189 } }, – Livingroom
function synchronize_temp( lul_device, lul_service, lul_variable, lul_value_old, lul_value_new )
for i = 1,#devices_to_synchronize
do
if devices_to_synchronize[ i ][ 1 ] == tonumber( lul_device )
then
for j = 1,#devices_to_synchronize[ i ][ 2 ]
do
luup.variable_set( 'urn:upnp-org:serviceId:TemperatureSensor1', 'CurrentTemperature', lul_value_new, devices_to_synchronize[ i ][ 2 ][ j ] )
end
end
end
end – synchronize_temp
for i = 1,#devices_to_synchronize
do
luup.variable_watch( ‘synchronize_temp’, ‘urn:upnp-org:serviceId:TemperatureSensor1’, ‘CurrentTemperature’, devices_to_synchronize[ i ][ 1 ] )
end[/code]
And insert that in the Lua sartup?
Thanks,
Cor