sfeakes / AquapureD

Control SWG without control panel. (Hayward Aquarite, Jandy Aquapure, Zodiac TRi)
Other
17 stars 3 forks source link

fullstatus not updating to 254 when off #2

Closed Kranzy closed 4 years ago

Kranzy commented 4 years ago

When the SWG is turned off or percentage is set to 0% the fullstatus value will remain at its current state, it doesn't update to 254 to indicate the unit is off.

sfeakes commented 4 years ago

254 was for powered off (ie not replying to RS messages). But with the way some of these units seem to be wired that’s not relevant. It was also confusing for the UI.

I need to think about the best way to approach this and not break integrations into home automation hubs and such.

Kranzy commented 4 years ago

That makes sense.

Would it be possible to have fullstatus send a value when percent is set to 0 or SWG is set to 0?

Just so I can update the status in home assistant based on values.

sfeakes commented 4 years ago

Just posted Version 0.6. For on/off you should use the aquapured/SWG topic. 0 is off, 2 is generating. For a detailed status use aquapured/SWG/fullstatus. But 0 will be "connected" or "generating", so if % is set to 0 or 100 you will get a 0 status, if all is good. This is the raw status from the RS485 information and I really don't want to mess with that.

Kranzy commented 4 years ago

Just posted Version 0.6. For on/off you should use the aquapured/SWG topic. 0 is off, 2 is generating. For a detailed status use aquapured/SWG/fullstatus. But 0 will be "connected" or "generating", so if % is set to 0 or 100 you will get a 0 status, if all is good. This is the raw status from the RS485 information and I really don't want to mess with that.

All good, Ill have a look in home assistant to use the SWG topic if off an the fullstatus topic when running.

Kranzy commented 4 years ago

I have created two sensors and a template sensor in home assistant to give me a combined status of the SWG.

For those interested code is below:

#SWG Status
  - platform: mqtt
    name: "SWG Status"
    state_topic: "aquapure/SWG/fullstatus"

#SWG Power Status
  - platform: mqtt
    name: "SWG Power Status"
    state_topic: "aquapure/SWG"

  - platform: template
    sensors:
      swg_status_values:
        friendly_name: "SWG Status"
        value_template: >-
          {% if is_state("sensor.swg_power_status", "0") %}
            Off
          {% elif is_state("sensor.swg_status", "0") %}
            On
          {% elif is_state("sensor.swg_status", "1") %}
            No Flow
          {% elif is_state("sensor.swg_status", "2") %}
            Low Salt
          {% elif is_state("sensor.swg_status", "4") %}
            High Salt
          {% elif is_state("sensor.swg_status", "8") %}
            Clean Cell
          {% elif is_state("sensor.swg_status", "9") %}
            Turning Off
          {% elif is_state("sensor.swg_status", "16") %}
            High Current
          {% elif is_state("sensor.swg_status", "32") %}
            Low Volts
          {% elif is_state("sensor.swg_status", "64") %}
            Low Temp
          {% elif is_state("sensor.swg_status", "128") %}
            Check PCB
          {% elif is_state("sensor.swg_status", "254") %}
            No Connection to SWG
          {% elif is_state("sensor.swg_status", "255") %}
            No Connection to SWG
          {%- endif %}