Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.113 and RFXCOM RFXTRX - Lost the Ability To Dim Lights #38107

Closed
rickjmatthews opened this issue Jul 23, 2020 · 15 comments
Closed

0.113 and RFXCOM RFXTRX - Lost the Ability To Dim Lights #38107

rickjmatthews opened this issue Jul 23, 2020 · 15 comments

Comments

@rickjmatthews
Copy link

Hi,

I've followed the updated documentation and moved all my RfxTrx entities out of "lights:" and into the "rfxtrx:" config entry... however in doing so I have lost the ability to dim the lights. Despite specifying device_class: light all the entities now seem to show up as switches which are non-dimmable.

RfxTrx

rfxtrx:
device: /dev/ttyUSB0
devices:
0a14004ef52d6a0d000060: # Master Bedroom
device_class: light
0a140016f52d6a0e010050: # Living Room 1
device_class: light

@probot-home-assistant
Copy link

rfxtrx documentation
rfxtrx source
(message by IssueLinks)

@elupus
Copy link
Contributor

elupus commented Jul 23, 2020

You need to change your event codes to ones with dimming commands.

0a14004ef52d6a0d020060
0a140016f52d6a0e020050

@foxy82
Copy link
Contributor

foxy82 commented Jul 23, 2020

You need to change your event codes to ones with dimming commands.

0a14004ef52d6a0d020060
0a140016f52d6a0e020050

Can you elaborate more on what this means (ideally in the docs)?

How can we tell that your event IDs have a dimming command and the original one doesn't? Is there a way to translate without re-adding everything?

Thinking more this means we need a warning in the docs that we need to be careful with automatic add (or grabbing the event id) as if we send a on/off instead of dim command first then we will lose dimming ability?

@rickjmatthews
Copy link
Author

You need to change your event codes to ones with dimming commands.

0a14004ef52d6a0d020060
0a140016f52d6a0e020050

Thank you for your reply, but I'm bit lost with this. Are you saying that If I change the 5th digit from the right to a '2' then it will be detected as a dimmable light rather than a binary switch? The codes were generated directly from the light switches around 4 years ago and have been dimming correctly whilst configured as lights.

I have amended the config as below and restarted, but it still shows up as an on/off switch.

rfxtrx:
device: /dev/ttyUSB0
devices:
0a14004ef52d6a0d000060: # Master Bedroom
device_class: light
0a140016f52d6a0e020050: #living room test
#0a140016f52d6a0e010050: # Living Room 1
device_class: light

@elupus
Copy link
Contributor

elupus commented Jul 23, 2020

Let's me check in more detail. I expected that to have worlwd.
We need to get a code that contain a dimming command to know it's a light. Device class doesn't help here.

When you added this way back, you likely pressed the on/off button rather than dimming.

@elupus
Copy link
Contributor

elupus commented Jul 23, 2020

These are what you should use (0x10 instead of 0x01/0x00. 0x10 is set level, 0x01 is on, 0x00 is off):
0a14004ef52d6a0d100060 # Master Bedroom
0a140016f52d6a0e100050 # Living Room 1

I need to figure out a way to explain in docs how to get these codes correct. @RobBie1221 do you have any thoughts on how we should explain. This is somewhat a duplicate of #38045.

@RobBie1221
Copy link
Contributor

Hmm, can't we do this through the UI? If we know what bit to flip to set from on/off to dimmable, we can provide an option for that.

@elupus
Copy link
Contributor

elupus commented Jul 23, 2020

Nah. It depends on the underlying device. But I think we should update docs to say that to add a light entity you need to trigger a dimming command.

@RobBie1221
Copy link
Contributor

Can't we get it from the underlying library based on device type? There is a lot of documentation around the whole code generation which imho should be hidden from the user as much as possible (not saying that we can always prevent it). For example, for RFY blinds in Rfxmng you set id and unit code but in ha you need to add a lot more to the code where we could just ask for type (=RFY) and properties (id/unit code).

@rickjmatthews
Copy link
Author

The lights are dimmable again!

These lights are Lightwave and it is not always easy to tell what command you are triggering with the switch. They only two buttons and only start to dim when you hold the button down and can be a little temperamental. I have a feeling I may have originally migrated the codes that were captured in Domoticz.

Would it not be easier if it observed the "device_class: light" set in the config then you wouldn't need to worry about tweaking the codes?

Anyway, many thanks for your help.

@elupus
Copy link
Contributor

elupus commented Jul 23, 2020

I will think about it. We want it to be as little manual editing as possible.

@Raarrrinator
Copy link

Raarrrinator commented Sep 5, 2020

Hi Folks!

I hope you can give me a hand here..

Based upon parts of tutorials I managed to migrate my rfxcom from Domoticz to HA. In Domoticz you had to add the the hardware using a dropdown and pick the USB source from a drop down; activate 'listen to devices for 5 minutes' and everything would show up in a table with 1 line per device. From there all you had to do is check the box to import and chose if you want to use it as a switch or dimmer. But what a quest this is in HA..

After some trail and error the rfxcom is added, entities are being discovered. I renamed entity ac_087e962_1 to light_zout by adding - platform: switch name: licht_zout entity_id: switch.ac_087e962_1. to light_switches.yaml. Used Lovelace to display it as a Light card. I also added the code out of 'states' to the devices list in config. So it looks like this now:

rfxtrx:
device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A13JM73-if00-port0
automatic_add: true
devices:
# Zout
0b1100010087e96201010f70:

The switch works using Lovelace.

But it's a dimmer. So I tried changing 0b1100010087e96201010f70 to 0b1100010087e96201020f70 which would make my config look like this:

rfxtrx:
device: /dev/serial/by-id/usb-RFXCOM_RFXtrx433_A13JM73-if00-port0
automatic_add: true
devices:
# Zout
0b1100010087e96201020f70:

But then the light becomes unavailable in Lovelace.

I can't make heads or tails of all of this.. What should I do to make this switch dimmable?

HA is really great and extensive, but these things make it sometimes really difficult. It's far from being ready for 1.0 and completely configurable using UI only.

Thanks a lot, hope you can help me out :)

Regards, Ruben

@rickjmatthews
Copy link
Author

I also migrated from Domoticz and the process for adding dimmable lights was a piece of cake. HomeAssistant is a bit more tricky but I think you're along the right lines. As far as I can tell, you basically have two options:

  • Remove the light and try again, but when you re-add it, make sure you dim light and not just switch it on/off. Hopefully HA will pick up a dim command and recognise it as a dimmable light.
    --OR--
  • Figure out which digits to modify in the generated command code and turn it into a dim command. As each manufacturer uses a different encoding, this is a nightmare! Once you have done this check in the RFXCOM integration that your entity name hasn't changed. When I manually modified the codes to make them dimmable, the entity ids changed from switch.xxxxxx to light.xxxxxx so I had to update my lovelace configuration accordingly

Hope this helps & good luck!

@Raarrrinator
Copy link

I also migrated from Domoticz and the process for adding dimmable lights was a piece of cake. HomeAssistant is a bit more tricky but I think you're along the right lines. As far as I can tell, you basically have two options:

  • Remove the light and try again, but when you re-add it, make sure you dim light and not just switch it on/off. Hopefully HA will pick up a dim command and recognise it as a dimmable light.
    --OR--
  • Figure out which digits to modify in the generated command code and turn it into a dim command. As each manufacturer uses a different encoding, this is a nightmare! Once you have done this check in the RFXCOM integration that your entity name hasn't changed. When I manually modified the codes to make them dimmable, the entity ids changed from switch.xxxxxx to light.xxxxxx so I had to update my lovelace configuration accordingly

Hope this helps & good luck!

Thanks a million Rick! You're second option did the trick.

It became unavailable because the switch got renamed to light when I changed 010f70 ot 020f70.

I had to remove the switch in light_switches.yaml to get rid of a config error, renamed the new entity to a friendlier name and added the new entity to lovelace and it worked!

@rickjmatthews
Copy link
Author

That's great - Glad you got it working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants