rfxcom2mqtt / backend

Rfxcom2mqtt backend
Apache License 2.0
0 stars 2 forks source link

payload_on default in topicWlll put on off #5

Open Rini52 opened 5 months ago

Rini52 commented 5 months ago

Sorry i'm a complete nono with node. But after docker reset the switches are always put on off (lighting2). If I change the payload to on in the discovery topic of the mqtt it works ok again. I think it is wrong in the file src/discovery/homeassistantdiscovery.ts at line 205:

payload_on: switchInfo.value_off,

should be : payload_on: switchInfo.value_on,

I would like to test it but I cannot rebuild with docker-compose build on my PI4 with 64bit : Uname ==> Linux pi-host 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

The nmp install fails (both node 18 and node 20)

Please help, because this addon is very usefull...

Regards

sguernion commented 5 months ago

hello,

thank you for your feedback,

I just made the modification, the docker image is being created and should be available soon.

https://github.com/rfxcom2mqtt/backend/actions/runs/8540965831

Regards

Rini52 commented 5 months ago

Hi,

Thanks a lot.The homeassistant switches work oke now after restart of docker image.

Will try to see if I can get the rebuild from github to work... But that maybe a little to complicated fro me ;)

Regards, Rini

sguernion commented 5 months ago

we need to define secrets "DOCKERHUB_TOKEN" and "DOCKERHUB_USERNAME" to push on dockerHub.

otherwise it should be possible to use github package by changing the configuration in actions

https://github.com/rfxcom2mqtt/backend/blob/main/.github/workflows/main.yml

Rini52 commented 5 months ago

Many thanks. Updating the docker secrets make it able to build a local image. Now i have to go trough a learning of github/docker with vscode to make it easier for my self I assume. How to use secret.Ussss etc file, so I don't have to change this main workflow when I re-clone your new git version? The "klikklak" switches work ok now both detected in Domoticz and HomeAssistant. Basically I have tow small things to sort out. 1) The remote doesn't set the switches in the "Home" software as well the group off (detected as a separate device) also doesn't. So need some little practice with settings I assume. 2) The Kerui D026 switch is set as sensor in HomeAssistant but not in Domoticz. Some of the sensor attributes (BatteryLevel) seems to have an odd value(9). Is it possible to adjust that in the config.yml ?

Again thanks a lot for helping out.

Rini52 commented 4 months ago

some updates:

1)The klikklak devices work okay after discovery both in Domoticz as well as Homeassistant. Both sides recoqnize the settings and commands.

2) The Kerui (d026) sensor also works on both platforms after the following mqtt publication:

topic: homeassistant_domoticz/binary_sensor/0x09D0/config

{ "name" : "X10_door_sensor", "value_template": "{{ value_json.deviceStatus | int(0) }}", "state_topic": "rfxcom2mqtt/devices/0x09D0", "unique_id": "x10_door_binary_sensor", "payload_off": "0", "payload_on": "2", "device_class": "garage_door" }

sguernion commented 4 months ago

the "security1" type is not yet supported for topic discovery for sensor X10_door

I created a feature request for this case.

but I don't know when I'll be able to do it, I don't have much time available.

https://github.com/rfxcom2mqtt/backend/issues/6

sguernion commented 4 months ago

can you share with me some rfxcom events you receive from your "Kerui (d026) sensor" device?

start with "receive from rfxcom :"

Rini52 commented 4 months ago

Hi See also email I send. screenschot_rfxmngr_1 This is a screen dump of rfcmngr using keruyi (do26) sensor. First is wen it opens, second is closed. This translate into the status=0 and status=2 with the current build code

Rini52 commented 4 months ago

setting the rfxcom to undecode gives..., but i'm not sure it was interrupted by others.... undecode_kerui_d026.txt

Rini52 commented 4 months ago

Hi Sguernion, I have an other one that is not included yet. The Chime (Byron SX) doorbell. Below the RFXcom discovery. How can I include this one in the code? Screenshot_byron_chime_rfxcom