Closed pkkrusty closed 3 months ago
Define an integer with I:lastseen=0 but when the script runs, the integer has the value 2130706432 and cannot change
I:lastseen=0
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
pivot-local/stat/RESULT = {"NAME":"Generic","GPIO":[1,1,1,1,1,1,1,1,1,1,1,1,1,1],"FLAG":0,"BASE":18} 13:02:19.410 0,1,1,0,0,0.0,0.0,0.0 13:02:19.551 SRC: Backlog 13:02:19.553 CMD: Grp 0, Cmd 'MODULE', Idx 1, Len 0, Pld -99, Data '' 13:02:19.557 MQT: pivot-local/stat/RESULT = {"Module":{"18":"Generic"}} 13:02:19.801 SRC: Backlog 13:02:19.803 CMD: Grp 0, Cmd 'GPIO', Idx 1, Len 3, Pld 255, Data '255' 13:02:19.809 MQT: pivot-local/stat/RESULT = {"GPIO0":{"0":"None"},"GPIO1":{"3200":"Serial Tx"},"GPIO2":{"0":"None"},"GPIO3":{"3232":"Serial Rx"},"GPIO4":{"608":"I2C SCL"},"GPIO5":{"640":"I2C SDA"},"GPIO9":{"0":"None"},"GPIO10":{"0":"None"},"GPIO12":{"224":"Relay1"},"GPIO13":{"225":"Relay2"},"GPIO14":{"226":"Relay3"},"GPIO15":{"0":"None"},"GPIO16":{"0":"None"},"GPIO17":{"0":"None"}}
Backlog Rule1; Rule2; Rule3
None
- [ ] Provide the output of this command: `Status 0`:
13:03:13.233 MQT: pivot-local/stat/STATUS = {"Status":{"Module":18,"DeviceName":"Pivot Local","FriendlyName":["Pivot Local","Tasmota2","Tasmota3"],"Topic":"pivot-local","ButtonTopic":"0","Power":6,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":0,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}} 13:03:13.241 MQT: pivot-local/stat/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Power On","Uptime":"4T02:30:38","StartupUTC":"2023-12-25T10:32:35","Sleep":50,"CfgHolder":4802,"BootCount":54,"BCResetTime":"2023-09-25T13:19:04","SaveCount":137,"SaveAddress":"FB000"}} 13:03:13.248 MQT: pivot-local/stat/STATUS2 = {"StatusFWR":{"Version":"13.1.0.3(tasmota)","BuildDateTime":"2023-09-25T13:11:10","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":160,"Hardware":"ESP8266EX","CR":"454/699"}} 13:03:13.254 MQT: pivot-local/stat/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":3,"MqttLog":0,"SysLog":2,"LogHost":"","LogPort":514,"SSId":["beersheba","pkkrusty"],"TelePeriod":60,"Resolution":"55C181C0","SetOption":["00608008","2805C80001000600003C5A00192800000000","000000C9","08006000","00004000","00000000"]}} 13:03:13.265 MQT: pivot-local/stat/STATUS4 = {"StatusMEM":{"ProgramSize":624,"Free":1420,"Heap":16,"ProgramFlashSize":4096,"FlashSize":4096,"FlashChipId":"1640D8","FlashFrequency":40,"FlashMode":"DOUT","Features":["00000809","0780068F","04080001","0000800F","00000600","40000000","00000080","00200000","00000800","00000000"],"Drivers":"1,2,3,4,8,9,10,20,38,50,56,59","Sensors":"1,2,3,12","I2CDriver":"13,26"}} 13:03:13.274 MQT: pivot-local/stat/STATUS5 = {"StatusNET":{"Hostname":"pivot-local","IPAddress":"192.168.3.87","Gateway":"192.168.2.1","Subnetmask":"255.255.254.0","DNSServer1":"192.168.2.1","DNSServer2":"0.0.0.0","Mac":"8C:CE:4E:CC:FB:17","Webserver":2,"HTTPAPI":1,"WifiConfig":4,"WifiPower":17.0}} 13:03:13.282 MQT: pivot-local/stat/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.3.48","MqttPort":1883,"MqttClientMask":"pkkrusty%06X","MqttClient":"pkkrusty_CCFB17","MqttUser":"pkkrusty","MqttCount":22,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":16}} 13:03:13.290 MQT: pivot-local/stat/STATUS7 = {"StatusTIM":{"UTC":"2023-12-29T13:03:13","Local":"2023-12-29T13:03:13","StartDST":"2023-03-26T02:00:00","EndDST":"2023-10-29T03:00:00","Timezone":"+00:00","Sunrise":"07:30","Sunset":"18:47"}} 13:03:13.297 MQT: pivot-local/stat/STATUS10 = {"StatusSNS":{"Time":"2023-12-29T13:03:13","Pivot":{"LastSeen":2130706432,"Pressure":0.0,"Current":0.0,"Temperature":0.0,"Upsecs":0,},"PressureUnit":"hPa","TempUnit":"C"}} 13:03:13.303 MQT: pivot-local/stat/STATUS11 = {"StatusSTS":{"Time":"2023-12-29T13:03:13","Uptime":"4T02:30:38","UptimeSec":354638,"Heap":14,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":22,"POWER1":"OFF","POWER2":"ON","POWER3":"ON","Wifi":{"AP":1,"SSId":"beersheba","BSSId":"20:C9:D0:21:AF:79","Channel":6,"Mode":"11n","RSSI":100,"Signal":-21,"LinkCount":2,"Downtime":"0T00:01:06"}}}
- [ ] Provide the output of the Console log output when you experience your issue; if applicable: _(Please use_ `weblog 4` _for more debug information)_
13:04:30.870 SRC: WebConsole from 192.168.2.103 13:04:30.872 CMD: Grp 0, Cmd 'SCRIPT', Idx 1, Len 11, Pld -99, Data '>lastseen=1' 13:04:30.877 MQT: pivot-local/stat/RESULT = {"Script":">lastseen=1"} 13:05:18.941 MQT: pivot-local/tele/STATE = {"Time":"2023-12-29T13:05:18","Uptime":"4T02:32:43","UptimeSec":354763,"Heap":17,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":22,"POWER1":"OFF","POWER2":"ON","POWER3":"ON","Wifi":{"AP":1,"SSId":"beersheba","BSSId":"20:C9:D0:21:AF:79","Channel":6,"Mode":"11n","RSSI":100,"Signal":-28,"LinkCount":2,"Downtime":"0T00:01:06"}} 13:05:18.949 MQT: pivot-local/tele/SENSOR = {"Time":"2023-12-29T13:05:18","Pivot":{"LastSeen":2130706432,"Pressure":0.0,"Current":0.0,"Temperature":0.0,"Upsecs":0,},"PressureUnit":"hPa","TempUnit":"C"}
### TO REPRODUCE Script follows:
D 48 SB=4096 IP=192.168.3.87 m:cvr=0 19 cntr=0 message="" I:fullepoch=0 I:lastseen=0 slot=0 pow1=0 pow2=0 pow3=0 pwr1state="" pwr2state="" pwr3state="" cmnd="" value="" mln=0 valln=0 colon=0 rupsecs="" temp=0 tmup=0 repoch=0 press=0 curr=0 B pow1=1 pow2=1 pow3=1 slot=1 lastseen=1 T ;curr=INA226_1#Current ;inavolt=INA226_1#Voltage E message=SerialReceived ti1 switch slot case 1 { serialsend2 time: slot+=1 } case 2 { send admin info slot+=1 } ends F pow1=pwr[1] pow2=pwr[2] pow3=pwr[3] S print %0pwr[1]%,%0pwr[2]%,%0pwr[3]%,%0tmup%,%0repoch%,%1temp%,%1press%,%1curr% value=sb(message 0 3) if (upd[message]>0 and (value=="...")) { value=sb(message 3 1) =>power1 %value% value=sb(message 5 1) =>power2 %value% value=sb(message 7 1) =>power3 %value% value=sb(message 9 8) tmup=value value=sb(message 18 9) repoch=value value=sb(message 28 4) temp=value value=sb(message 33 4) press=value value=sb(message 38 4) curr=value lastseen=0 } if lastseen<100000 { lastseen+=1 }
D 48 SB=4096 IP=192.168.3.87 m:cvr=0 19 cntr=0 message="" I:fullepoch=0 I:lastseen=0 slot=0 pow1=0 pow2=0 pow3=0 pwr1state="" pwr2state="" pwr3state="" cmnd="" value="" mln=0 valln=0 colon=0 rupsecs="" temp=0 tmup=0 repoch=0 press=0 curr=0
B pow1=1 pow2=1 pow3=1 slot=1 lastseen=1
T ;curr=INA226_1#Current ;inavolt=INA226_1#Voltage
E message=SerialReceived
ti1 switch slot case 1 { serialsend2 time: slot+=1 } case 2 { send admin info slot+=1 } ends
F pow1=pwr[1] pow2=pwr[2] pow3=pwr[3]
S print %0pwr[1]%,%0pwr[2]%,%0pwr[3]%,%0tmup%,%0repoch%,%1temp%,%1press%,%1curr% value=sb(message 0 3) if (upd[message]>0 and (value=="...")) { value=sb(message 3 1) =>power1 %value% value=sb(message 5 1) =>power2 %value% value=sb(message 7 1) =>power3 %value% value=sb(message 9 8) tmup=value value=sb(message 18 9) repoch=value value=sb(message 28 4) temp=value value=sb(message 33 4) press=value value=sb(message 38 4) curr=value lastseen=0 } if lastseen<100000 { lastseen+=1 }
;1970-01-01 00:00:00Z
if ((secs==0) and (mins==0)) { fullepoch=epoch+1546300800 =>serialsend2 time:%0fullepoch% delay(400) } if chg[pow1]>0 { =>serialsend2 power1:%0pow1% delay(400) =>serialsend2 power1:%0pow1% } if chg[pow2]>0 { =>serialsend2 power2:%0pow2% delay(400) =>serialsend2 power2:%0pow2% } if chg[pow3]>0 { =>serialsend2 power3:%0pow3% delay(400) =>serialsend2 power3:%0pow3% }
J ,"Pivot":{ "LastSeen":%0lastseen%, "Pressure":%1press%, "Current":%1curr%, "Temperature":%1temp%, "Upsecs":%0tmup%, } W pwr1=%0pwr[1]%, pwr2=%0pwr[2]% pwr3=%0pwr[3]%, pow1=%0pow1% pwr1state=%pwr1state%, remotetemp=%temp% ```
J ,"Pivot":{ "LastSeen":%0lastseen%, "Pressure":%1press%, "Current":%1curr%, "Temperature":%1temp%, "Upsecs":%0tmup%, }
W
Integer variables to behave normally
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
(Please, remember to close the issue when the problem has been addressed)
except in >D you must assign with i(x)
e.g. lastseen=i(999)
PROBLEM DESCRIPTION
Define an integer with
I:lastseen=0
but when the script runs, the integer has the value 2130706432 and cannot changeREQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:Backlog Rule1; Rule2; Rule3
:13:03:13.233 MQT: pivot-local/stat/STATUS = {"Status":{"Module":18,"DeviceName":"Pivot Local","FriendlyName":["Pivot Local","Tasmota2","Tasmota3"],"Topic":"pivot-local","ButtonTopic":"0","Power":6,"PowerOnState":3,"LedState":1,"LedMask":"FFFF","SaveData":1,"SaveState":0,"SwitchTopic":"0","SwitchMode":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":0,"SensorRetain":0,"PowerRetain":0,"InfoRetain":0,"StateRetain":0,"StatusRetain":0}} 13:03:13.241 MQT: pivot-local/stat/STATUS1 = {"StatusPRM":{"Baudrate":9600,"SerialConfig":"8N1","GroupTopic":"tasmotas","OtaUrl":"http://ota.tasmota.com/tasmota/release/tasmota.bin.gz","RestartReason":"Power On","Uptime":"4T02:30:38","StartupUTC":"2023-12-25T10:32:35","Sleep":50,"CfgHolder":4802,"BootCount":54,"BCResetTime":"2023-09-25T13:19:04","SaveCount":137,"SaveAddress":"FB000"}} 13:03:13.248 MQT: pivot-local/stat/STATUS2 = {"StatusFWR":{"Version":"13.1.0.3(tasmota)","BuildDateTime":"2023-09-25T13:11:10","Boot":31,"Core":"2_7_4_9","SDK":"2.2.2-dev(38a443e)","CpuFrequency":160,"Hardware":"ESP8266EX","CR":"454/699"}} 13:03:13.254 MQT: pivot-local/stat/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":3,"MqttLog":0,"SysLog":2,"LogHost":"","LogPort":514,"SSId":["beersheba","pkkrusty"],"TelePeriod":60,"Resolution":"55C181C0","SetOption":["00608008","2805C80001000600003C5A00192800000000","000000C9","08006000","00004000","00000000"]}} 13:03:13.265 MQT: pivot-local/stat/STATUS4 = {"StatusMEM":{"ProgramSize":624,"Free":1420,"Heap":16,"ProgramFlashSize":4096,"FlashSize":4096,"FlashChipId":"1640D8","FlashFrequency":40,"FlashMode":"DOUT","Features":["00000809","0780068F","04080001","0000800F","00000600","40000000","00000080","00200000","00000800","00000000"],"Drivers":"1,2,3,4,8,9,10,20,38,50,56,59","Sensors":"1,2,3,12","I2CDriver":"13,26"}} 13:03:13.274 MQT: pivot-local/stat/STATUS5 = {"StatusNET":{"Hostname":"pivot-local","IPAddress":"192.168.3.87","Gateway":"192.168.2.1","Subnetmask":"255.255.254.0","DNSServer1":"192.168.2.1","DNSServer2":"0.0.0.0","Mac":"8C:CE:4E:CC:FB:17","Webserver":2,"HTTPAPI":1,"WifiConfig":4,"WifiPower":17.0}} 13:03:13.282 MQT: pivot-local/stat/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.3.48","MqttPort":1883,"MqttClientMask":"pkkrusty%06X","MqttClient":"pkkrusty_CCFB17","MqttUser":"pkkrusty","MqttCount":22,"MAX_PACKET_SIZE":1200,"KEEPALIVE":30,"SOCKET_TIMEOUT":16}} 13:03:13.290 MQT: pivot-local/stat/STATUS7 = {"StatusTIM":{"UTC":"2023-12-29T13:03:13","Local":"2023-12-29T13:03:13","StartDST":"2023-03-26T02:00:00","EndDST":"2023-10-29T03:00:00","Timezone":"+00:00","Sunrise":"07:30","Sunset":"18:47"}} 13:03:13.297 MQT: pivot-local/stat/STATUS10 = {"StatusSNS":{"Time":"2023-12-29T13:03:13","Pivot":{"LastSeen":2130706432,"Pressure":0.0,"Current":0.0,"Temperature":0.0,"Upsecs":0,},"PressureUnit":"hPa","TempUnit":"C"}} 13:03:13.303 MQT: pivot-local/stat/STATUS11 = {"StatusSTS":{"Time":"2023-12-29T13:03:13","Uptime":"4T02:30:38","UptimeSec":354638,"Heap":14,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":22,"POWER1":"OFF","POWER2":"ON","POWER3":"ON","Wifi":{"AP":1,"SSId":"beersheba","BSSId":"20:C9:D0:21:AF:79","Channel":6,"Mode":"11n","RSSI":100,"Signal":-21,"LinkCount":2,"Downtime":"0T00:01:06"}}}
13:04:30.870 SRC: WebConsole from 192.168.2.103 13:04:30.872 CMD: Grp 0, Cmd 'SCRIPT', Idx 1, Len 11, Pld -99, Data '>lastseen=1' 13:04:30.877 MQT: pivot-local/stat/RESULT = {"Script":">lastseen=1"} 13:05:18.941 MQT: pivot-local/tele/STATE = {"Time":"2023-12-29T13:05:18","Uptime":"4T02:32:43","UptimeSec":354763,"Heap":17,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":22,"POWER1":"OFF","POWER2":"ON","POWER3":"ON","Wifi":{"AP":1,"SSId":"beersheba","BSSId":"20:C9:D0:21:AF:79","Channel":6,"Mode":"11n","RSSI":100,"Signal":-28,"LinkCount":2,"Downtime":"0T00:01:06"}} 13:05:18.949 MQT: pivot-local/tele/SENSOR = {"Time":"2023-12-29T13:05:18","Pivot":{"LastSeen":2130706432,"Pressure":0.0,"Current":0.0,"Temperature":0.0,"Upsecs":0,},"PressureUnit":"hPa","TempUnit":"C"}
;1970-01-01 00:00:00Z
if ((secs==0) and (mins==0)) { fullepoch=epoch+1546300800 =>serialsend2 time:%0fullepoch% delay(400) } if chg[pow1]>0 { =>serialsend2 power1:%0pow1% delay(400) =>serialsend2 power1:%0pow1% } if chg[pow2]>0 { =>serialsend2 power2:%0pow2% delay(400) =>serialsend2 power2:%0pow2% } if chg[pow3]>0 { =>serialsend2 power3:%0pow3% delay(400) =>serialsend2 power3:%0pow3% }
EXPECTED BEHAVIOUR
Integer variables to behave normally
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
Add any other context about the problem here.
(Please, remember to close the issue when the problem has been addressed)