Update an device Kelvin -> Celsius -> crash Topic is solved

Moderator: leecollings

Post Reply
niki_lauda
Posts: 118
Joined: Saturday 31 August 2013 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Eindhoven (NL)
Contact:

Update an device Kelvin -> Celsius -> crash

Post by niki_lauda »

I'm trying to write a lua script and its crashing domoticz.

What am I doing wrong?

Code: Select all

The  log 
2025-02-12 13:51:01.311 Status: LUA: 281.15
2025-02-12 13:51:01.311 Status: LUA: 8.15
2025-02-12 13:51:01.311 Status: LUA: 8.0
2025-02-12 13:51:01.311 Status: LUA: Temp8.0
2025-02-12 13:51:01.312 Error: Domoticz(pid:2948081, tid:2977392('luaThread')) received fatal signal 6 (Aborted)
2025-02-12 13:51:01.312 Error: siginfo address=0x2cfbf1, address=0x7f81f609fc 
The LUA

Code: Select all

commandArray = {}

	print( tonumber(otherdevices['Batterij in Kelvin']))
	print( tonumber(otherdevices['Batterij in Kelvin']) -273)
 	temp = tostring( tonumber(otherdevices['Batterij in Kelvin']) -273.15)
 	print (temp)
	commandArray['UpdateDevice'] = {'3012|0|'.. tostring(temp)}
 	print ('Temp'  ..temp)
return commandArray

Found the culprit if you use commandArray['UpdateDevice'] ={3012|0|'.. tostring(temp)}
Domoticz crashes.
You should use commandArray['UpdateDevice'] = '3012|0|'.. tostring(temp)
Last edited by niki_lauda on Wednesday 12 February 2025 20:35, edited 1 time in total.
User avatar
waltervl
Posts: 5852
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Update an device Kelvin -> Celsius

Post by waltervl »

Moved to Lua forum.
Sorry I cannot help you, I only use dzvents...
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest