Hi,
I am new to Homeseer scripting and I am trying to publish my ZWave devices on MQTT.
I am successful in publishing in values but the status values are published as integers.
mosquitto_sub output:
I assume there is some database entry somewhere for those strings but there isn't a lot of documentation. I tried writing a script trying to set a virtual device value with the string but I have an error using the hs.setdevicevaluebyref function.
What would be the best way to get that string into a device value that the MQTT plugin could use?
I am new to Homeseer scripting and I am trying to publish my ZWave devices on MQTT.
I am successful in publishing in values but the status values are published as integers.
mosquitto_sub output:
zwave/bathroom/light/security 8
zwave/bathroom/light/security 0
zwave/bathroom/light/security 8
zwave/bathroom/light/security 0
zwave/bathroom/sensor/security 0
zwave/bathroom/light/security 8
zwave/bathroom/sensor/security 8
zwave/bathroom/light/security 0
zwave/bathroom/light/security 8
zwave/bathroom/light/security 0
zwave/door_lock/door_lock_status 128
zwave/door_lock/door_lock_status 64
zwave/bathroom/sensor/security 0
zwave/bathroom/light/level 0
zwave/bathroom/sensor/temperature 68.9
zwave/bathroom/sensor/humidity 71
zwave/bathroom/sensor/luminance 2
zwave/door_lock/door_lock_status 128
zwave/door_lock/door_lock_status 64
zwave/door_lock/door_lock_status 128
zwave/door_lock/door_lock_status 64
zwave/bathroom/light/security 0
zwave/bathroom/light/security 8
zwave/bathroom/light/security 0
zwave/bathroom/sensor/security 0
zwave/bathroom/light/security 8
zwave/bathroom/sensor/security 8
zwave/bathroom/light/security 0
zwave/bathroom/light/security 8
zwave/bathroom/light/security 0
zwave/door_lock/door_lock_status 128
zwave/door_lock/door_lock_status 64
zwave/bathroom/sensor/security 0
zwave/bathroom/light/level 0
zwave/bathroom/sensor/temperature 68.9
zwave/bathroom/sensor/humidity 71
zwave/bathroom/sensor/luminance 2
zwave/door_lock/door_lock_status 128
zwave/door_lock/door_lock_status 64
zwave/door_lock/door_lock_status 128
zwave/door_lock/door_lock_status 64
Code:
&dim d dim str dim dvref dvref = hs.GetDeviceRefByName("ACN") hs.writelog "device ref", dvref d = hs.devicevaluebyname("Access Control Notification") hs.writelog "device string", hs.DeviceStringByName("Access Control Notification") hs.writelog "device value", d Select Case d Case 1 str = "Manual Lock" Case 2 str = "Manual Unlock" Case 3 str = "RF Lock" Case 4 str = "RF Unlock" Case 5 str = "Keypad Lock" Case 6 str = "Keypad Unlock" Case 9 str = "Auto Lock Locked" Case 11 str = "Lock Jammed" Case Else str = "Unassigned" End Select hs.writelog "operation string", str hs.setdevicevaluebyref(dvref, str, True))
Comment