Drayton Wiser Home Assistant Integration

Are you able to create a template binary sensor from the standard sensor provided by the integration using the YAML from my post here?

This mimics the state of the standard sensor. Given what we are seeing in the Automation Editor UI, I suspect using this will fix it and it will give us an idea of whether this is being caused by a sensor being used in the integration instead of a binary sensor.

Then use the new binary sensor you created as your trigger.

But this sensor does not use Wiser Heating or am I missing something?

Change sensor.wiser_hub_heating to sensor.wiser_heating. Iā€™ve renamed mine.

For your/standard setup:

template:
  - binary_sensor:
      # Wiser Heating binary sensor
      - name: Wiser Heating
        icon: >-
          {%- if is_state('binary_sensor.wiser_heating', 'on') -%}
            mdi:radiator
          {%- else -%}
            mdi:radiator-disabled
          {%- endif -%}
        state: "{{ states('sensor.wiser_heating') }}"

Without getting @robertwigley on his soap box again about binary sensors, you need to change your off and on to Off and On.

And yes, I know!! :slight_smile:

4 Likes

Good spot!

P.S. Iā€™ve updated to HA Core 2024.2.5 and installed 3.4.3 and can also confirm the fix for minimum setpoint is working as intended.

1 Like

Hey guys, THANKS. The On/Off works, as I expect the created sensor will too. Thanks again.

So, all I need feedback on best solution for an issue.

When you set a room to off, the actual target temp reported by the hub is -20C. We used to just show that but had complaints that is caused poor visuals on graphs as it dropped significantly negative.

We now set this to off. However, as HA and other integrations have developed, this is now causing an issue in that Off is not a valid temp value and certainly does not have a UOM.

So, what should we do with this? My suggestion is maybe set it to 0C but wanted to guage feeling.

I think if you set it to undefined it will not register anything and not show anything on graphs. I am using undefined for some template sensors for graphs and it is an invisible state/value. However, unfortunately I donā€™t know whether that will be a valid value either. All I know is it works in a template sensor that I use for creating the fill when heating under the current temperature in the History Explorer card:

# Living Room Heating Graph sensor
- name: Living Room Heating Graph
  icon: >-
    {%- if is_state('binary_sensor.living_room_heating', 'on') -%}
      mdi:radiator
    {%- else -%}
      mdi:radiator-disabled
    {%- endif -%}
  state: >-
    {%- if is_state('binary_sensor.living_room_heating', 'on') -%}
      {{ states('sensor.living_room_climate_temperature') }}
    {%- else -%}
      undefined
    {%- endif -%}

image

If undefined doesnā€™t work in this context, and from a quick test in Developer Tools it doesnā€™t look like it will, then probably setting it to 0C makes sense. Itā€™s better than the -20C reported by the hub at least.

Alternatively, what about setting it to the target temperature of the schedule, or the last state it was before switching off?

Sorry if itā€™s a stupid question, but what is a UOM?

I think setting it to 0C makes sense as it will give a numerical value in cards ie the thermostat card, which is expected. If heating is Off then that sort of logically equates to 0, ie On = 1 and Off = 0.

If undefind is used wonā€™t that give an error or no displayed value?

This is part of the problem as the schedule can also be off and leaving it on the last state i think would look odd as it will look like heating is not firing.

I was also going to look if i can make it unavailable and what that would do.

Thanks all for your responses.

Seems like there is no clear solution to this then unless there is some sort of undefined / unavailable / null / none / unknown state it can be set to. 0C gets my vote if there are no alternatives that work.

1 Like

UOM = Unit Of Measure

@msp1974 Zero degrees gets my vote.

1 Like

Hi Robert,

My code is nearly the same. Maybe I copied your code because I too have this ā€˜undefinedā€™ as part of my heat graph sensor in configuration.yaml.

I have changed one sensor to this to see how if it works.

      conservatory_temp:
        value_template: "{{ state_attr('climate.wiser_conservatory', 'current_temperature')}}"
        device_class: temperature
        friendly_name: 'Conservatory'
        unit_of_measurement: Ā°C
      conservatory_target_temp:
        value_template: "{{ state_attr('climate.wiser_conservatory', 'temperature')}}"
        device_class: temperature
        friendly_name: 'Conservatory Target'
        unit_of_measurement: Ā°C
      conservatory_heat_graph:
        value_template: >-
          {% if state_attr('climate.wiser_conservatory', 'is_heating') %}
            {{ states('sensor.conservatory_temp') }}
          {% else %}
            0
          {% endif %}
        friendly_name: 'Conservatory Heating'
        unit_of_measurement: Ā°C

Although I am using the climate entity, not a binary sensor. :wink: :laughing:

Edit:
Maybe it needs device_class: temperature as well?

Quite possibly. I am fairly sure I posted the code for this ages ago, miles back up the thread. :slight_smile:

I donā€™t think it would need device_class: temperature, but I really donā€™t know. Itā€™s unexplored territory there.

For the heat graph sensors for use with the History Explorer card, I think I tried setting it to 0C and it didnā€™t work as intended. Iā€™m pretty sure that the author of that card said to use undefined for that reason.

That rings a bell (undefined) - its a pity Alex has marked this End of Life.

All because of a moderator :cry:

:man_facepalming: I hadnā€™t realised (or have forgotten) that it had been marked End of Life! Thatā€™s a real shame. If you know why, or have more details, I would be interested to hear why/what happened for him to abandon it. PM me though rather than clogging up the thread here.

Another thing I am eventually going to have to find a replacement and rewrite loads of stuff for. :frowning:

For my point of view 0 C should be also the best way to show the off temperature , itā€™s a numeric value and it will be consistent even with future version of HAā€¦

Should it be possible ( makes it sense) to let the user choose an off temperature in the setting of the integration?

1 Like

I think you are correct. 0C produces strange results in the History Explorer card.
Edited it back to undefined - see what tomorrow brings :crossed_fingers:

From a bit of research in this issue unavailable and unknown are the options we have.

@msp1974 might want to confirm/test it as well.

If not, I also vote for the 0 degrees.

1 Like

just a thought how about 0Ėšc if the switch.wiser_valve_protection is set to off, and 5Ėšc if set to on ??, if enabled it is in reality 5Ėšc