ridiekel / jeletask

An open source java API for Teletask domotics (https://www.teletask.be/).
https://github.com/ridiekel/jeletask
GNU General Public License v3.0
5 stars 4 forks source link

relays remain on status unknown, although MQTT shows the correct state. #39

Open tomdevos2401 opened 1 year ago

tomdevos2401 commented 1 year ago

teletask2mqtt/MyTeleTask/relay/2/state shows the correct state in MQTT: {"state":"OFF"} for dimmers, all seems to look fine.

is this a know issue? and if so, how can I resolve this? if not, which logs can I provide because there are no logs that I can find to share.

thanks for the support!

tomdevos2401 commented 1 year ago

I've investigated a bit further, and I got to the point where I think that for relays in the mqtt config publication the usage of "state_value_template" should be "state_template". does that make sense? if I create a manual mqtt entry in configuration.yaml of homeassistant by using "state_template" it works just fine.

bertca commented 12 months ago

Tom, Can you give an example of manual mqtt entry (for a switch)?

Bert

fvquicke commented 9 months ago

Hi, I'm having the same issue. Can you please share a working manual mqtt entry in configuration.yaml? Thanks, Frederic.

NickiHB commented 4 months ago

I'm having the same issue, i'm assuming you defined the MQTT manual, rather than using the Auto discovery?

tomdevos2401 commented 4 months ago

I'm having the same issue, i'm assuming you defined the MQTT manual, rather than using the Auto discovery?

What I actually did to get this solved is to use auto discovery, but overwrite the MQTT discovery configuration via node red. I'm sure there are more elegant ways than this, like updating the java code but unfortunately I don't have the necessary time or knowledge to do this.

[{"id":"46bf8fb6be729caa","type":"tab","label":"MQTT","disabled":false,"info":"","env":[]},{"id":"e2b528de9f686564","type":"mqtt in","z":"46bf8fb6be729caa","name":"switches","topic":"homeassistant/switch/MyTeleTask/#","qos":"0","datatype":"json","broker":"8a874f85e9afe075","nl":false,"rap":true,"rh":0,"inputs":0,"x":100,"y":80,"wires":[["1730e6dc392bb8a4"]]},{"id":"45ba9b79f25fafc5","type":"mqtt out","z":"46bf8fb6be729caa","name":"","topic":"","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"8a874f85e9afe075","x":390,"y":280,"wires":[]},{"id":"e198fb7f92444ab4","type":"debug","z":"46bf8fb6be729caa","name":"debug 12","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"topic","targetType":"msg","statusVal":"payload","statusType":"auto","x":560,"y":300,"wires":[]},{"id":"4f2e1cd3ef443aa3","type":"change","z":"46bf8fb6be729caa","name":"","rules":[{"t":"set","p":"payload.value_template","pt":"msg","to":"(payload.state_value_template)","tot":"jsonata"},{"t":"delete","p":"payload.state_value_template","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":200,"wires":[["45ba9b79f25fafc5","e198fb7f92444ab4"]]},{"id":"1730e6dc392bb8a4","type":"switch","z":"46bf8fb6be729caa","name":"","property":"payload.value_template","propertyType":"msg","rules":[{"t":"nempty"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":410,"y":100,"wires":[[],["4f2e1cd3ef443aa3"]]},{"id":"8a874f85e9afe075","type":"mqtt-broker","name":"","broker":"192.168.3.14","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]