Trigger heap pumps off forecast?

Hi all,

I have done the Mitsubishi heat pump hack as seen here

I’m trying to have the modes of my 6 splits based off the outside weather

I can select the weather as a device but I don’t get any triggers for it?

Ideally if the weather is going to be cold I want the heat pumps in heat mode, hot cool mode, and if the weather is going to be in a comfort range to just turn the system off

Any tips?

Thanks,
Jay

Grock tried to help, but I just get errors

- alias: "Optimize Mini-Splits Efficiency + Forecast + Humidity Hedge"
  trigger:
    - platform: time_pattern
      minutes: "/15"
  action:
    - variables:
        outdoor_temp: "{{ states('sensor.outdoor_temp') | float(50) }}"
        forecast_low: "{{ state_attr('weather.home', 'forecast')[0].templow | float(45) if is_state('binary_sensor.internet','on') else outdoor_temp }}"
        forecast_high: "{{ state_attr('weather.home', 'forecast')[0].temperature | float(75) if is_state('binary_sensor.internet','on') else outdoor_temp }}"
        humidity: "{{ states('sensor.indoor_humidity') | float(50) }}"
        heat_set_down: "{{ 69 + ((forecast_low - outdoor_temp) * 0.35) | round(0) if forecast_low < 55 else 69 }}"
        heat_set_up: "{{ 66 + ((forecast_low - outdoor_temp) * 0.25) | round(0) if forecast_low < 55 else 66 }}"
        cool_set_down: "{{ 76 - ((forecast_high - outdoor_temp) * 0.25) | round(0) if forecast_high > 78 else 76 }}"
        cool_set_up: "{{ 78 - ((forecast_high - outdoor_temp) * 0.2) | round(0) if forecast_high > 78 else 78 }}"
    - condition: state
      entity_id: input_boolean.manual_override
      state: "off"
    - choose:
        - conditions: "{{ outdoor_temp < 62 or forecast_low < 55 }}"
          sequence:
            - service: climate.set_hvac_mode
              target: { entity_id: [climate.downstairs_group, climate.upstairs_group] }
              data: { hvac_mode: "heat" }
            - service: climate.set_temperature
              target: { entity_id: climate.downstairs_group }
              data: { temperature: "{{ heat_set_down }}" }
            - service: climate.set_temperature
              target: { entity_id: climate.upstairs_group }
              data: { temperature: "{{ heat_set_up }}" }}
        - conditions: "{{ outdoor_temp > 70 or forecast_high > 82 }}"
          sequence:
            - service: climate.set_hvac_mode
              target: { entity_id: [climate.downstairs_group, climate.upstairs_group] }
              data: { hvac_mode: "cool" }
            - service: climate.set_temperature
              target: { entity_id: climate.downstairs_group }
              data: { temperature: "{{ cool_set_down if humidity <= 55 else cool_set_down - 1 }}" }
            - service: climate.set_temperature
              target: { entity_id: climate.upstairs_group }
              data: { temperature: "{{ cool_set_up if humidity <= 55 else cool_set_up - 1 }}" }
            - choose:
                - conditions: "{{ humidity > 55 }}"
                  sequence:
                    - service: climate.set_preset_mode
                      target: { entity_id: [climate.downstairs_group, climate.upstairs_group] }
                      data: { preset_mode: "dry" }}
        - conditions: "{{ is_state('binary_sensor.internet', 'off') }}"
          sequence:
            - service: climate.set_temperature
              target: { entity_id: climate.downstairs_group }
              data: { temperature: 69 }
            - service: climate.set_temperature
              target: { entity_id: climate.upstairs_group }
              data: { temperature: 66 }}
  mode: single

Second automation

automation:
  - alias: "Turn Off Splits - Comfort Range (65-77°F)"
    trigger:
      - platform: time_pattern
        minutes: "/15"
    condition:
      - condition: numeric_state
        entity_id: sensor.outdoor_temp
        above: 64.9
        below: 77.1
      - condition: numeric_state
        entity_id: sensor.indoor_humidity
        below: 55
    action:
      - service: climate.turn_off
        target:
          entity_id: [climate.downstairs_group, climate.upstairs_group]
    mode: single

No, it really didn't...

The attribute forecast was removed from weather entities like 3 years ago. There are examples of how to retrieve forecast data in the docs linked above as well as on these forums (try searching for "weather.get_forecasts").

I'm pretty sure that, when using json in YAML, you need quotes around string values...

target: { entity_id: ["climate.downstairs_group", "climate.upstairs_group"] }

YAML uses line structure, indentation, and dashes instead of parentheses, brackets, etc to make it more readable than json. While json can be used in YAML, it kind of defeats the purpose unless you are already comfortable with it. It also adds another layer for us to debug when you ask for help.

There are multiple lines like this that have an extra } at the end because the stochastic parrot did the math wrong.

1 Like

Yeah grok sucks

Slowly getting there

alias: EnergySave Good Wx
description: ""
triggers:
  - trigger: time
    at: "00:30:00"
conditions:
  - condition: numeric_state
    entity_id: sensor.nws_-REDACTED-_temperature
    above: 64
    below: 77
actions:
  - device_id: 321e33d5a9477bcea75385374e1d98fd
    domain: climate
    entity_id: ec056b242c8ef27f105d8cce1d3dd241
    type: set_hvac_mode
    hvac_mode: "off"
  - device_id: dde65488b26be2e4031916c05100b835
    domain: climate
    entity_id: 772a69617c286e99d8ef914447038247
    type: set_hvac_mode
    hvac_mode: "off"
  - device_id: dc1435c41838e814de907b4b89a2bc02
    domain: climate
    entity_id: 62a7b52089276a7d576181ea88bb71c6
    type: set_hvac_mode
    hvac_mode: "off"
  - device_id: 2e69838a92aa999e56cfdae4789e4924
    domain: climate
    entity_id: 5c669acfdf4d88b7f06ea7d99dddf8ae
    type: set_hvac_mode
    hvac_mode: "off"
  - device_id: 651944e09ceaf191b1cdc88ea5376cce
    domain: climate
    entity_id: 9add380f94a1eb4fb98755cac9c806a0
    type: set_hvac_mode
    hvac_mode: "off"
  - device_id: 193c817f0da04cee81c8c004c04b8b35
    domain: climate
    entity_id: d675e5af17e5f079868dd98b79a68a4b
    type: set_hvac_mode
    hvac_mode: "off"
mode: single

So every 30min it will check for good weather and power down the pumps if it’s good.

Now just need to make the inverse

Plus have it check the forecast and set the temps accordingly

Eating the elephant one bite at a time (I don’t know mix about coding if that wasn’t obvious) and I am grateful for the knowledge here

30 min past, station reports 68f, one of the splits is still on …

That trigger is not for "every 30 minutes"... it fires once a day at half past midnight.


alias: Trigger Every 30 minutes (on the hour and at half-past)
trigger: time_pattern
minutes: /30

The Action block would be a lot more readable if you used standard actions instead of Device Actions... it would just be one action:

actions:
  - action: climate.set_hvac_mode
    target:
      device_id: 
        - 321e33d5a9477bcea75385374e1d98fd
        - dde65488b26be2e4031916c05100b835
        - dc1435c41838e814de907b4b89a2bc02
        - 2e69838a92aa999e56cfdae4789e4924
        - 651944e09ceaf191b1cdc88ea5376cce
    data:
      hvac_mode: "off"

Personally I would use Entities as the target, again, because I find it easier to read that way.

Also, if that list represents all the climate entities you have, you can use the keyword all:

actions:
  - action: climate.set_hvac_mode
    target:
      entity_id: all
    data:
      hvac_mode: "off"
Putting it all together
alias: EnergySave Good Wx
description: |
  Every 30 minutes, if the NWS temperature is between 64-77, turn off the heat pumps.
triggers:
  - alias: On each hour and at half-past each hour
    trigger: time_pattern
    minutes: /30
conditions:
  - alias: Check if the NWS temperature is between 64-77
    condition: numeric_state
    entity_id: sensor.nws_-REDACTED-_temperature
    above: 64
    below: 77
actions:
  - action: climate.set_hvac_mode
    target:
      device_id: 
        - 321e33d5a9477bcea75385374e1d98fd
        - dde65488b26be2e4031916c05100b835
        - dc1435c41838e814de907b4b89a2bc02
        - 2e69838a92aa999e56cfdae4789e4924
        - 651944e09ceaf191b1cdc88ea5376cce
    data:
      hvac_mode: "off"
mode: single
1 Like

Thank you sir

Would that also allow the system to reactive when the temp goes out of that range, or would that be another automation for above (cool) and below (heat)?

Still leaning

There isn't currently anything in this automation to do that.

You could incorporate that into this automation, using a Choose or If/Then action to branch the logic... or you can set it up as a separate automation. It's mostly down to personal preference.

Since you are starting out, you might want to do it as separate automations... it will make it easier to debug if there are issues. You can always combine them later on, once you have each aspect working the way you want it to.

1 Like

Made a shutdown automation for good weather

And cold temp automation to set in heat mode

A high temp automation for cool mode

And a high humidity one for dry

Still need to test a bit more

What’s the logic on not using triggers?

I don't know what you are referencing here....?

Avoid Device Triggers

For the specific instance of what you shared in the original post... Because the Met.No integration does not provide any usable triggers as a "device". The general reasons to avoid Device components are covered, in detail, in the post I linked to.

Still learning, thanks