Brightness 0-100 not 255

Tags: #<Tag:0x00007f73ac1396c0> #<Tag:0x00007f73ac1395f8>

I have a isy994zw controller with the dimmable zwave switches and plugs. The problem im facing is that HA shows that the devices have a dimmable range of 0 to 255. This is not the case. They only go from 0 to 100. If i try to use the slider in ha and go max the light does not brighten at all. I have to move it in the 0 to 100 range of the slider to get it to be 100% brightness in the isy controller. In the screenshot below the lamp is 100% brightness in the isy controller but in ha its less than halfway. Im not sure how to fix this. Any advice?

I have searched and searched and cannot find any good examples of how to fix this… Anybody have any ideas?

1 Like

Just use the brightness_pct: instead of brightness. It should convert to device units as defined in the ozw log

Might be a novice question but where do you define that for the device?

About 42% seems to be as high as i can go in the ui… which is 100% for the light in the isy controller…

image

This is what my config looks like…

image

image

Sorry, should have explained in a bit more depth
I use the pct call in automations and scripts.
I’m away from home at the moment but have looked at my configuration (don’t seem to be able to select and copy remotely, so check the yaml spacing and the characters look right but I’m not sure of this keyboard either) but here is an example, it’s under a data_template: as I have it use user set values. You could just use data:

  action:
    - service: light.turn_on
      entity_id: light.fib_fgd212dim2_lvgr_level
      data_template:
        brightness_pct: >
          {{ states('input_number.in_aalight_all_lvl') | int }}
        transition: >
          {{ states('input_number.in_aalight_transition_time') | int }} 

Not sure of your config behind the widget you show but how do you know it’s set to 42 and your light is set to 255 ?
If you have a problem with the numbers you’ll have to convert between e.g. *100/42 or *255/42 depending on what numbers you are dealing with.
Hope this helps.
If you need more help, someone else will need to help until I get back
Mutt

Edit : not sure here as the thread is called 0-100 not 0-255 so I assume your widget was 0-100 and your light needed 255 so your value would need multiplying by 255/100 before applying to the light, again I’m not sure I’ve hit the right nail, or even on the right barn

So the widget is showing like 40% … but in the isy the light is 100% and in the states section of home assistant the light is showing this…


So im a little confused as to why the widget is only setting 40% for 100% brightness… if i have the light set to 5% brightness on the widget the the actual brightness on the light is 12%… image also if i set the widget to 100% after it being set to 5% then the light stays at 12% on the isy and shows as 12% on the states page. So something with the widget isnt translating right. I also have a TPlink Dimmer switch and that one has no issue at all 100% on the widget is 100% on the switch its 1 to 1. The widget to isy is not. if that makes more sense.

Sorry, what is ‘isy’ ?
Did you configure the widget ?
Can you view its configuration ?
Is it the same as the widget you use for the TPLink dimmer ?

It seems the isy integration is using brightness as a percentage instead of 0-255. So when you set it to 100% in isy it sets the brightness attribute of the light to 100 of 255 instead of 255 of 255. It should actually be setting the brightness_pct attribute instead of brightness.

To be honest I think this can only really be fixed in the isy component for HA.

maybe not related, but i also have dimmers, i need to send values from 00 to 90 …
yeah, actually 90 is actually 100% or 255 , so and to make it even hard, i need to send the values in hex format :slight_smile:

so this my code :


    dimmer4:
      friendly_name: "Living Doorgang"
      value_template: "{{ states.sensor.prog.state[42:44] != '00' }}" 
      level_template: "{{ ( states('sensor.Prog')[42:44] | int(base=16) / 90 * 255 ) | int }}"

      turn_on:
        - service: input_number.set_value
          data:
            entity_id: input_number.dimmer4
            value: 255
        - service: shell_command.dimmer4
      turn_off:
        - service: input_number.set_value
          data:
            entity_id: input_number.dimmer4
            value: 0
        - service: shell_command.dimmer4

      set_level:
        - service: input_number.set_value
          data_template:
            entity_id: input_number.dimmer4
            value: "{{ brightness }}"
        - service: shell_command.dimmer4

to actually send /set the level of my light, i use TCP commands, this is the value i need to send :
so i have created an input_number from 0 to 255 , if i set it, it will recalculate to 00 - 90 in hex

{{ '%02.f'%((((states('input_number.dimmer1') | float / 255 ) * 90) // 10) * 10) }}

Isy994 controller https://www.home-assistant.io/components/isy994/ I don’t think the brightness_pct works either I think it’s something with the integration that needs to be fixed.

Brightness percent uses brightness, so it won’t work. Gotta make a template light that maps to your component light, or get someone to fix the component. But there is a chance that the component works fine and just your hardware has the issue. Personally, I’d go template route as that’s the fastest avenue to working correctly.

@pergola.fabio posted a great example of a template light that will solve your issue

So, I read your link. X10 is a pretty old standard.
You seem pretty new to HA, so I’m wondering why.?
Did you inherit the X10 gear, (maybe built in to the house you bought ?)
If the equipment was originally installed by you and you are just updating the hub then you must have been one of the earliest adopters.
That’s awesome.

i actually have the zwave model… its a isy994izw/ir pro when I was looking for a zwave controller at the time i never heard of homeassistant and wanted something commercial grade. Which it works really well other than the translation of the widget brightness to the light. I do plan to eventually switch to the tplink dimmers and switches because they seem to work really well and i like the local control over ip.

It really seemes to be the lovelace light card. Is there a way to set a template on that so that it can translate the dimmer properly?

Yeah , I remember you helped me with that :wink:

Not for something like that. I doubt the card is what is broken, otherwise more people would be complaining. If you adjust your light via the states page and it doesn’t illuminate past 40% like you say, then it’s not the lovelace card, it’s the hardware or component.

I think it’s the connect because I can’t even set the state via the states page… I can only change the state using the widget up to 40% which translates to 100% on the isy device and 100% on the brightness setting for the state on the states page.

Then you should stop fighting this ‘light template’ and just let it happen. It will solve your issues!

Here, i’ll even make it easy for you.

light:
  - platform: template
    lights:
      scene_switch_003:
        friendly_name: "Living Doorgang"
        value_template: "{{ is_state('light.zw_003_scene_switch','on') }}" 
        level_template: "{{ states('light.zw_003_scene_switch') | int / 100 * 255 }}"
        turn_on:
          - service: light.turn_on
            entity_id: light.zw_003_scene_switch
        turn_off:
          - service: light.turn_off
            entity_id: light.zw_003_scene_switch
        set_level:
          - service: light.turn_on
            data_template:
              entity_id: light.zw_003_scene_switch
              brightness: "{{ brightness / 255 * 100}}"

Thanks for that but i gave up on Zwave… Went with some Treatlife dimmers flashed with tasmota and they are 100% better that the zwave switches! Must faster and with turning on and controlling the switch. Also IP based so I can log into each device and control them that way as well.