maxwellhadley / node-red-contrib-rfxcom

node-RED nodes to access an RFXtrx433 transceiver
BSD 2-Clause "Simplified" License
22 stars 13 forks source link

LIGHTING5 / LIVOLO / Scene #37

Closed MosesHill closed 4 years ago

MosesHill commented 6 years ago

Will you implement the LIVOLO SCENE feature?

It will turn the LIVOLO into a real ON/OFF switch.

maxwellhadley commented 6 years ago

I looked at this a while back and left it because I didn't understand how scenes were supposed to work, and I don't have any Livolo devices to experiment with. Most of the necessary code is in place, as I have implemented 'moods' for the LightwaveRF devices, which seem to be similar.

If you cold answer some of my questions and run some tests for me that would help!

Please can you describe how you use the remote control to define and select scenes, to help me understand the documentation I have here. If possible, I would like you to run some tests using the remote control, but that can wait a bit!

maxwellhadley commented 6 years ago

Hmm... I just saw today's announcement for firmware release 1023 includes 'Livolo updated' as a change. I wonder what difference this will make?

MosesHill commented 6 years ago

To answer your questions:

About the remote control: The manual: https://www.livoloeurope.eu/livolo-new-style-touch-remote-controller-wall-light-remote-switch-controller-vl-rmt-03 At the bottom of the last page you see a table. Are these command codes, number of possible scenes og a combination ?!?! What I know for sure is, that a 2way switch (a switch communicating with another switch, so you can have 2 switches in each end of a room both controlling the same lamp) only can remember 1 SCENE. If it has only 1 button it is ok, but if it has more, then the 1 possible SCENE is setting all buttons on that switch unit at the same time. This can then not be used to have true ON for all the buttons. I sent back all my 2way. Where I need the 2way functionality, I only use 1 button switches.

MosesHill commented 6 years ago

I have discussed this SCENE issue with the developer of the rfxcom unit. We found out, that only firmware 1022 works, when using the Manager Software from rfxcom. It does not work with your red-node rfxcon nodes? I am not sure, but I think the scene command is "SCENE1", "SCENE2". Is that supported in your nodes?

maxwellhadley commented 6 years ago

It is supported in node-rfxcom, but not (yet) in node-red-contrib-rfxcom, although I don't have any hardware to test it on. I was planning to look into the current issues on Sunday, if I get a few hours free (not guaranteed, unfortunately)

MosesHill commented 6 years ago

I can test it for you. I have RFXtrx433E, Livolo switches and dimmers. Both 1gang and 2 gang switches and a couple of 1 gang 2way switches (2way is coupled switches, where 2 switches can control one lamp).

Just drop me a mail !

Marcel

Den 9. mar. 2018 kl. 19.06 skrev Max Hadley notifications@github.com:

It is supported in node-rfxcom, but not (yet) in node-red-contrib-rfxcom, although I don't have any hardware to test it on. I was planning to look into the current issues on Sunday, if I get a few hours free (not guaranteed, unfortunately)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxwellhadley/node-red-contrib-rfxcom/issues/37#issuecomment-371896057, or mute the thread https://github.com/notifications/unsubscribe-auth/AhxI1Z8GwORAw_shKdpoAsM_rW-kfpZMks5tcsS6gaJpZM4RdXY0.

maxwellhadley commented 6 years ago

I have put something together here for you to try. The rfx-lights-out node now accepts a message with a payload of Scene x, where x is the scene number, and tries to send the Scene command. This is only supported by the LIVOLO_APPLIANCE device (packet type 0x14, Lighting5; subtype 0x0A) and it will send the commands 0x04 for x=1 and 0x05 for x=2. You will get an error for any other scene numbers, or any other device type.

According to the RFXCOM SDK documentation, there are also commands 0x08 and 0x09 available. These are called 'Scene1 room2' and 'Scene2 room2', but from what you describe, the room number is actually encoded in the address. If that is so, then this version should be able to control all three rooms if you set the address appropriately. You must include a unit number in the address, but I think it will be ignored. I used LIVOLO_APPLIANCE/0x123/1 to test, and the command was accepted by my RFXtrx433E, running firmware version 1022, but I have nothing to receive it. How do you know what address to use, since the RFXtrx433E does not receive the Livolo remotes?

Were you able to successfully control your Livolo switches from RFXmgr? If so, what command bytes did you use? You can see the command bytes sent from my nodes if you set an environment variable RED_DEBUG=rfxcom before starting Node-RED. There will be lots of diagnostic messages from the nodes, including the actual bytes sent.

I have not published this version to npm. To try it out, you need to download the modified file from github, and use it in place of the existing rfxcom.js file (rename the existing file to something else first). Be careful! There are two files called rfxcom.j, in different directories. the one you want to change will be in node_modules/node-red-contrib-rfxcom, it is the only .js file in that directory, and there will be a file called rfxcom.html in the same directory. The other, wrong rfxcom.js file is in a directory called lib, and there are lots of other .js files there.

Please try it out and let me know how you get on.

MosesHill commented 6 years ago

Hi Max

I will try it out. Maybe already Monday evening. I will send you a mail.

Regards Marcel

Den 11. mar. 2018 kl. 20.42 skrev Max Hadley notifications@github.com:

I have put something together here for you to try. The rfx-lights-out node now accepts a message with a payload of Scene x, where x is the scene number, and tries to send the Scene command. This is only supported by the LIVOLO_APPLIANCE device (packet type 0x14, Lighting5; subtype 0x0A) and it will send the commands 0x04 for x=1 and 0x05 for x=2. You will get an error for any other scene numbers, or any other device type.

According to the RFXCOM SDK documentation, there are also commands 0x08 and 0x09 available. These are called 'Scene1 room2' and 'Scene2 room2', but from what you describe, the room number is actually encoded in the address. If that is so, then this version should be able to control all three rooms if you set the address appropriately. You must include a unit number in the address, but I think it will be ignored. I used LIVOLO_APPLIANCE/0x123/1 to test, and the command was accepted by my RFXtrx433E, running firmware version 1022, but I have nothing to receive it. How do you know what address to use, since the RFXtrx433E does not receive the Livolo remotes?

Were you able to successfully control your Livolo switches from RFXmgr? If so, what command bytes did you use? You can see the command bytes sent from my nodes if you set an environment variable RED_DEBUG=rfxcom before starting Node-RED. There will be lots of diagnostic messages from the nodes, including the actual bytes sent.

I have not published this version to npm. To try it out, you need to download the modified file from github, and use it in place of the existing rfxcom.js file (rename the existing file to something else first). Be careful! There are two files called rfxcom.j, in different directories. the one you want to change will be in node_modules/node-red-contrib-rfxcom, it is the only .js file in that directory, and there will be a file called rfxcom.html in the same directory. The other, wrong rfxcom.js file is in a directory called lib, and there are lots of other .js files there.

Please try it out and let me know how you get on.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

MosesHill commented 6 years ago

Exactly !! That did the trick. About the command numbers: You must be right about the ROOM2 scenes. It does not make any sense if they would use another address - why call them room2 then. So for every address, there must be Scene 1, Scene 2, Scene 1 Room 2, Scene 2 Room2. The command numbers are then 4,5,8 and 9.

Just to explain my setup: I set up some cathegories: Room, Position, Hardware. Put all my rooms, all kind of positions (Ceiling, table, wall, floor...) and all Hardware (Lamp,Spot,TV,Uplight...) in them. Then I let Alexa interview me until there is enough information and let her send over the selection in the cathegories. From that I then calculate an address that fits into 3xN+1, where N is a positive integer, so that the result does not exceed 7FFF, which is the maximum address for Livolo. So the same words will give me the same address. I don't care about which address that is !!! When I want to set up some new "Floor uplight in the bedroom", I just connect the Livolo switch, press and hold the button for 5 seconds "BIP" and then tell Alexa to "Turn on the Uplight on the floor in the bedroom". Done ! So no programming needed to add (or remove) a hardware. BUT I now only have a toggle function and an OFF command for that hardware. So I have to program once more for the "scene 1" command, which then gives me the ON command.

maxwellhadley commented 6 years ago

Marcel,

I'm afraid I'm still not quite clear. Were you able to control scenes in all 3 rooms using the modified node? If so, then the 0x08 & 0x09 commands appear to be redundant. There must be something missing as the new controller supports 3 rooms but the RFXtrx433 only supports 2.

I can't follow at all how you use Alexa to find the address to send from Node-RED. I couldn't find any Alexa skill for Livolo. Do you use some sort of third party hub device to interface your Livolo switches with Alexa? I can see in that case how Alexa might be able to discover the Livolo switches, but I can't see how you would find out the actual address.

Max

MosesHill commented 6 years ago

I tested both "Scene 1" and "Scene 2" and both worked, so these are as the RfxCom unit want's it. Without some sniffer for the transmission from the remote control, I cannot tell you, what is going on with the other rooms on a remote. Maybe I will get that Sniffer possibility from the RfxCom guys :-)

My setup is the RfxCom on a Raspberry Pi 3 with Node-Red. Alexa with Custom skills and the Lambda function in Node-Red on the Pi. Any Livolo Remote address smaller than 7FFF seems acceptable for the Livolo switches, but some say that only (3xN+1) where N is an integer is valid.

You program the switch by pressing and holding the switch for 5 seconds whereafter you send a Toggle Command for a valid address and a 1-10 button number. Now this switch toggles when Toggle is sent to this address again. What I made Node-Red do is my own formular, that calculates a valid address from the words from Alexa. Thus giving the same words you get the same address. It's just "these words" gives "This address". I do not care what the address is. I just want the switch I programmed for these words to act when these words are said. That is a way to get rid of programming every time you need another hardware added.

maxwellhadley commented 6 years ago

Marcel,

OK I understand now: it's like HomeEasy or Somfy - you put the device into pair mode and it learns its address & unit number from the next command to arrive. You 'invent' your own address from Node-RED. Presumably you are using Ben Hardill's Alexa node to associate the names of your Livolo devices with the addresses you have programmed. So you don't need to bother with 'rooms' at all, and indeed you wouldn't know which room your invented address corresponded to anyway. Unless 3xN+0 is room 1, 3xN+1 is room 2, and 3xN+2 is room 3.

Have you tried to see how many devices you can associate with a single scene? As I read the Livolo documents, there should be a limit of 9 devices with the same address.

MosesHill commented 6 years ago

The number of scenes one switch unit can handle is very weird. I mentioned it to Livolo as I had got lots of 2 gang 2 way switches (2 switches in 1 unit. Able to handle communication with up to 2 other switches to collectively handle one lamp), but the unit could only handle 1 scene ?!?! So there was no way to create a "true ON" (scene is used) functionality for each switch on the unit.

They accepted to swap them for other combination. The 1 gang 2 way switch would work, as one switch in the unit only needs one scene.

It was a bit annoying, that I could not see this anywhere in the documentation before buying ... It showed up in a table at the last page of the REMOTE CONTROL manual :-(. Look for your self. https://www.livoloeurope.eu/livolo-new-style-touch-remote-controller-wall-light-remote-switch-controller-vl-rmt-03

It is still a little uncertain how this should be interpreted.

maxwellhadley commented 6 years ago

Marcel,

I think I will add support for a room number as well - it can be made optional and somebody might need it. So a payload of 'scene 1 room 1' would work the same as 'scene 1', or you could send 'scene 1 room 2' (or 'room 2 scene 1').

In your discussions with Bert, did you discover what the problem was with firmware 1023 & 1024? Presumably there will be an update at some point.

Max

MosesHill commented 6 years ago

That is ok to have the room also (if it is needed or will be needed for the other scenes).

When I talked to Bert he immediately asked me to try out the 1022 version - as if he knew ! We have not been talking about, what the problem was with the newer versions. But he will get back to me maybe in a week or two. Maybe we will discuss it then.

maxwellhadley commented 6 years ago

I have implemented room number support for both the Scene and Dim commands for Livolo. To ensure compatibility with other lighting types that use the Dim command, this requires changes to the underlying node-rfxcom package. I have been in contact with Bert, and it looks like there will be a new release of the firmware soon, to solve the known issue with 1023 & 1024 over the Scene command, and I have asked him to look at implementing the third room available on the latest remotes. I will hold off publishing the updated versions of these packages until 1025 is out.

maxwellhadley commented 6 years ago

Version 2.4.0 published to npm. This supports Livolo scene commands for rooms 1 & 2. Firmware version 1025 recommended. Room 3 support is not yet available.

maxwellhadley commented 5 years ago

The handing of the 10-channel Livolo system has been completely changed in firmware version 1026. Room numbers are no longer used, but 4 scenes are supported: you can also send the 'OK/Set' command. I will be issuing an update soon, until then don't update your RFXtrx433E firmware!

maxwellhadley commented 5 years ago

Should work now with both 'old' (<1026) and 'new' (1026 and above) firmware. With the new firmware, the room number is not used, but 4 scenes are available

MosesHill commented 5 years ago

Hi Maxwell. Where can I get the 1026 version. It is not on the RFXCOM homepage. That is only 1025. With my current Firmware 1022 I get en error on the RFXCOM node, but it still works ?!

maxwellhadley commented 5 years ago

The latest version of the RFXCOM firmware is now up to 1035 (released last Friday!) and available here. The node will detect any version >= 1026 and use the new format. Older versions are still supported, using the scene/room number concept as before.

The original RFXtrx433's are limited to version 1025: later versions are only available for the E and XL transceivers.

MosesHill commented 5 years ago

Ok. I got the Node-Red program working:

Node-Red RFXCOM node version 2.7.0 RFXCOM Firmware 1035 Pro 1 (recommended version by hardware manufacturer)

BUT

  1. When I used RFXCOM manager and selected RESET RFXCOM I got an error. return value of 255 not valid.
  2. The RFXCOM node always has an error (red mark). No additional info.

Den 10. feb. 2019 kl. 20.42 skrev Max Hadley notifications@github.com:

The latest version of the RFXCOM firmware is now up to 1035 (released last Friday!) and available here http://www.rfxcom.com/epages/78165469.sf/en_GB/?ObjectPath=/Shops/78165469/Categories/Downloads. The node will detect any version >= 1026 and use the new format. Older versions are still supported, using the scene/room number concept as before.

The original RFXtrx433's are limited to version 1025: later versions are only available for the E and XL transceivers.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxwellhadley/node-red-contrib-rfxcom/issues/37#issuecomment-462164879, or mute the thread https://github.com/notifications/unsubscribe-auth/AhxI1SvZ2kwIAN3jVu8ITfoA59jyIBwkks5vMHYTgaJpZM4RdXY0.

maxwellhadley commented 5 years ago

I think I have seen the same error: with software version Pro 1031, the transmit power was returned as 0xff instead of the correct value 0x1c. I catch this bug in my software. I reported it to RFXCOM but it looks like it hasn't been fixed yet. (My test unit is still at version 1031). It shouldn't affect node operation.

By red mark, do you mean that the status (below the node) is showing red 'disconnected', or that there is a red dot on the node itself at top right, indicating a node configuration error? Does it still work when the red mark is showing? Do you see any warning messages in the Node-RED debug pane?

MosesHill commented 5 years ago

I mean the solid red triangle on the top of the node telling about an error. The node is connected, showing the correct version 1035, pro 1 and is working fine. Just every time I compile, I get the message about the error.

By the way: Do you know how much time it takes for the RFXCOM to send one Livolo Command? When I ask Alexa to turn on/off a single Light, it works fine, but if I ask her to "turn off all light upstairs", there is always 1 or 2 lights, that do not turn off - and not always the same lights. I tried to buffer the message in a node and send them of into the RFXCOM node in interval of 2 seconds and then let the RFXCOM node repeat the command after 1 second, but still - not all lights turn off.

maxwellhadley commented 5 years ago

The RFXCOM always queues messages, so it will finish sending one message before sending the next. It always leaves a short gap, to listen for other devices transmitting. If you are using the 'repeat after delay' function of the node I suggest setting at least 10 seconds as the delay.

The node setting that is generating the red triangle should have a red box around it when you edit the node settings - can you see one?

MosesHill commented 5 years ago

Ok. Thanks

When I edit the node I have 4 settings by default:

Serial Port = “/dev/ttyUSB0" Address = “get address from message topic” (that is the default setting) Repeat = “send each command once only” (that is the default setting) Name = not set, so I get the default name on the front end.

Den 12. feb. 2019 kl. 20.53 skrev Max Hadley notifications@github.com:

The RFXCOM always queues messages, so it will finish sending one message before sending the next. It always leaves a short gap, to listen for other devices transmitting. If you are using the 'repeat after delay' function of the node I suggest setting at least 10 seconds as the delay.

The node setting that is generating the red triangle should have a red box around it when you edit the node settings - can you see one?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxwellhadley/node-red-contrib-rfxcom/issues/37#issuecomment-462909215, or mute the thread https://github.com/notifications/unsubscribe-auth/AhxI1frY0aRrkEkK_1JBFk61pGe2m54Iks5vMxuigaJpZM4RdXY0.

MosesHill commented 5 years ago

… and none of the settings are marked with a red box.

Den 12. feb. 2019 kl. 20.53 skrev Max Hadley notifications@github.com:

The RFXCOM always queues messages, so it will finish sending one message before sending the next. It always leaves a short gap, to listen for other devices transmitting. If you are using the 'repeat after delay' function of the node I suggest setting at least 10 seconds as the delay.

The node setting that is generating the red triangle should have a red box around it when you edit the node settings - can you see one?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/maxwellhadley/node-red-contrib-rfxcom/issues/37#issuecomment-462909215, or mute the thread https://github.com/notifications/unsubscribe-auth/AhxI1frY0aRrkEkK_1JBFk61pGe2m54Iks5vMxuigaJpZM4RdXY0.