Home Assistant - New Zealand

Sure thing. Let me get it working correctly first, then I’ll share. Ive currently got all the “Current Weather” stuff working in basic form.

1 Like

Hi,
Fairly new to home assistant, but using it now in anger for a couple of months. I’m a kiwi living in South Island. Reason for post is I’ve got warm floor thermostats/title heating working with home assistant and from there into HomeKit. Required a mod to the local Tula integration but works pretty well. Warm floor is a Nz company so if anyone is interested in it let me know. I’ve had a chat to the company and they are going to put a howto up on their website.
Cheers
Miles

3 Likes

Welcome @milesroper , chch here. Don’t have that equipment, but happy to form a SI group :wink:

I did get this going and it seems to be fairly reliable, however I have not checked it out fully and I know that there is still issues at certain times of the day with the data. Plus all the div IDs are specific to Tauranga and you would need to change them for other cities. I just wish we had a proper API provided by the met service.

multiscrape:
  - name: WeatherWatch Tauranga Forcast
    resource: https://www.weatherwatch.co.nz/forecasts/Tauranga
    scan_interval: 3600
    sensor:
      - unique_id: weatherwatch_tauranga_summary
        name: WeatherWatch Tauranga Summary
        icon: mdi:text-long
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-heading.grid-item.grid-width-12 > p"
      - unique_id: weatherwatch_tauranga_alertforcast
        name: WeatherWatch Tauranga Alert Forcast
        icon: mdi:cloud-alert
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-487647650.alert-wrapper.grid-width-12.alert-no-link-wrapper > div > div > div"
        on_error:
          log: false
          value: default
          default: "No Alerts"
      - unique_id: weatherwatch_tauranga_currenttemp
        name: WeatherWatch Tauranga Current Temperature 
        value_template: "{{ value.replace('°', '') }}"
        state_class: measurement
        unit_of_measurement: "°C"
        device_class: temperature
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div.jsx-66893679.current-conditions.grid-item.grid-width-4 > div.jsx-3619355618.conditions-slider > div > div > div > div.slick-slide.slick-active.slick-current > div > div > div > div:nth-child(1) > div.jsx-3024714417.temp"
      - unique_id: weatherwatch_tauranga_todaystemp
        name: WeatherWatch Tauranga Todays Temperature 
        value_template: "{{ value.replace('°', '')|float(0) }}"
        state_class: measurement
        unit_of_measurement: "°C"
        device_class: temperature
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div:nth-child(2) > div.jsx-238692970.forecast.day.grid-container-4 > div.jsx-238692970.summary-block.grid-item.grid-width-3 > div.jsx-238692970.temp"
      - unique_id: weatherwatch_tauranga_tonightsstemp
        name: WeatherWatch Tauranga Tonights Temperature 
        value_template: "{{ value.replace('°', '') }}"
        state_class: measurement
        unit_of_measurement: "°C"
        device_class: temperature
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div:nth-child(3) > div.jsx-238692970.forecast.night.grid-container-4 > div.jsx-238692970.summary-block.grid-item.grid-width-3 > div.jsx-238692970.temp"
      - unique_id: weatherwatch_tauranga_rain
        name: WeatherWatch Tauranga Rain
        value_template: "{{ value.replace('mm', '')|float(0) }}"
        state_class: measurement
        unit_of_measurement: "mm"
        device_class: precipitation
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div.jsx-66893679.current-conditions.grid-item.grid-width-4 > div.jsx-3619355618.conditions-slider > div > div > div > div.slick-slide.slick-active.slick-current > div > div > div > div.jsx-3024714417.bottom-section.grid-item.grid-width-4.grid-container-3 > div.jsx-3024714417.details.grid-item.grid-width-2 > span:nth-child(1)"
      - unique_id: weatherwatch_tauranga_wind
        name: WeatherWatch Tauranga Wind
        value_template: "{{ value.split(' ')[1] | replace('km/h', '') }}"
        state_class: measurement
        unit_of_measurement: "km/h"
        device_class: wind_speed
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div.jsx-66893679.current-conditions.grid-item.grid-width-4 > div.jsx-3619355618.conditions-slider > div > div > div > div.slick-slide.slick-active.slick-current > div > div > div > div.jsx-3024714417.bottom-section.grid-item.grid-width-4.grid-container-3 > div.jsx-3024714417.details.grid-item.grid-width-2 > span:nth-child(2)"
        attributes:
          - name: Wind Direction
            value_template: "{{ value.split(' ')[0] }}"
            select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div.jsx-66893679.current-conditions.grid-item.grid-width-4 > div.jsx-3619355618.conditions-slider > div > div > div > div.slick-slide.slick-active.slick-current > div > div > div > div.jsx-3024714417.bottom-section.grid-item.grid-width-4.grid-container-3 > div.jsx-3024714417.details.grid-item.grid-width-2 > span:nth-child(2)"
      - unique_id: weatherwatch_tauranga_humidity
        name: WeatherWatch Tauranga Humidity
        value_template: "{{ value.replace('%', '') }}"
        state_class: measurement
        unit_of_measurement: "%"
        device_class: humidity
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div.jsx-66893679.current-conditions.grid-item.grid-width-4 > div.jsx-3619355618.conditions-slider > div > div > div > div.slick-slide.slick-active.slick-current > div > div > div > div.jsx-3024714417.bottom-section.grid-item.grid-width-4.grid-container-3 > div.jsx-3024714417.details.grid-item.grid-width-2 > span:nth-child(4)"
      - unique_id: weatherwatch_tauranga_pressure
        value_template: "{{ value.replace('hPa', '') }}"
        state_class: measurement
        unit_of_measurement: "hPa"
        device_class: atmospheric_pressure
        name: WeatherWatch Tauranga Pressure
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div.jsx-66893679.current-conditions.grid-item.grid-width-4 > div.jsx-3619355618.conditions-slider > div > div > div > div.slick-slide.slick-active.slick-current > div > div > div > div.jsx-3024714417.bottom-section.grid-item.grid-width-4.grid-container-3 > div.jsx-3024714417.details.grid-item.grid-width-2 > span:nth-child(5)"
      - unique_id: weatherwatch_tauranga_chanceofrain
        name: WeatherWatch Tauranga Chance Of Rain
        select: "#__next > div.jsx-1060093929.grid-container.weather-forecast.for.tauranga > div.jsx-1060093929.grid-width-12.grid-wrapper.section-wrapper-home > div.jsx-66893679.forecasts-top-block-wrapper.grid-width-12 > div > div > div.jsx-66893679.forecast-summaries.grid-container.grid-width-12 > div:nth-child(2) > div.jsx-238692970.forecast.day.grid-container-4 > div.jsx-238692970.bottom-section.grid-item.grid-width-4.grid-container-3 > div.jsx-238692970.details.grid-item.grid-width-2 > span:nth-child(1)"

Adding to this NZ tread, im using the multiscrape HACS add-on to get Powershop daily rates based off excellent work from @joem & @xbmcnut in other threads. This works very well!

multiscrape:
  - name: Powershop Rates
    resource: 'https://secure.powershop.co.nz/rates'
    log_response: true
    scan_interval: 43200 #every 12hrs
    form_submit:
      submit_once: true
      resource: 'https://secure.powershop.co.nz'
      select: ".content > form"
      input:
        email: !secret powershop_user
        password: !secret powershop_pass
    sensor:
      - unique_id: powershop_offpeak
        name: Powershop Off Peak
        select: "#main_container > div > div.row > div.rates-table-container.base-rates-table > table > tbody > tr:nth-child(1) > td.base-rates.current > span.rate.gst_inclusive"
        unit_of_measurement: "NZD/kWh"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary     
      - unique_id: powershop_peak
        name: Powershop Peak
        select: "#main_container > div > div.row > div.rates-table-container.base-rates-table > table > tbody > tr:nth-child(2) > td.base-rates.current > span.rate.gst_inclusive"      
        unit_of_measurement: "NZD/kWh"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary 
      - unique_id: powershop_weekend
        name: Powershop Weekend
        select: "#main_container > div > div.row > div.rates-table-container.base-rates-table > table > tbody > tr:nth-child(3) > td.base-rates.current > span.rate.gst_inclusive"      
        unit_of_measurement: "NZD/kWh"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary 
      - unique_id: powershop_offpeak_special
        name: Powershop Off Peak Special
        select: "#main_container > div > div.row > div.rates-table-container.special-rates-table > table > tbody > tr:nth-child(1) > td.base-rates.current > span.rate.gst_inclusive"
        unit_of_measurement: "NZD/kWh"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary     
      - unique_id: powershop_peak_special
        name: Powershop Peak Special
        select: "#main_container > div > div.row > div.rates-table-container.special-rates-table > table > tbody > tr:nth-child(2) > td.base-rates.current > span.rate.gst_inclusive"      
        unit_of_measurement: "NZD/kWh"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary
      - unique_id: powershop_weekend_special
        name: Powershop Weekend Special
        select: "#main_container > div > div.row > div.rates-table-container.special-rates-table > table > tbody > tr:nth-child(3) > td.base-rates.current > span.rate.gst_inclusive"      
        unit_of_measurement: "NZD/kWh"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary
      - unique_id: powershop_daily_charge
        name: Powershop Daily Charge
        select: "#main_container > div > div.row > div.rates-table-container.base-rates-table > table > tbody > tr:nth-child(4) > td.base-rates.current > span.rate.gst_inclusive"      
        unit_of_measurement: "NZD"
        value_template: '{{ (value | int) / 100 | float | round(3)}}'
        device_class: monetary      
        on_error:
          log: warning
          value: last

I have then setup a Schedule Helpers with the Peak, Off Peak, Weekend periods and an automation to change a Number Helper with the rates:

alias: Powershop Update Current Rate
description: ""
trigger:
  - platform: state
    entity_id:
      - schedule.power_weekday_peak
    from: "off"
    to: "on"
    id: peak
  - platform: state
    entity_id:
      - schedule.power_weekday_off_peak
    from: "off"
    to: "on"
    id: offpeak
  - platform: state
    entity_id:
      - schedule.power_weekend_off_peak
    from: "off"
    to: "on"
    id: weekend
condition: []
action:
  - service: input_number.set_value
    data:
      value: "{{ states('sensor.powershop_'~trigger.id~'_special') }}"
    target:
      entity_id: input_number.powershop_current_kwh_cost
mode: single

This is now all working well in the Energy Dashboard having just installed a Shelly EM with a 120AMP clamp onto the main house grid feed.

2 Likes

Now i have added the suggestion as follows which splits out the electrical charge and the daily power shop charge. I had to add the following entities:


  - sensor:
    - name: "Powershop Supply Charge"
      unit_of_measurement: "Wh"
      device_class: energy
      state_class: total_increasing
      state: >-
        {{ int(as_timestamp(now()) | timestamp_custom("%d")) + 1 - int(as_timestamp("2023-08-03") | timestamp_custom("%d")) }}

  - platform: template
    sensors:
      powershop_supply_charge_nzd_wh:
        friendly_name: "Powershop Supply Charge NZD Wh"
        unit_of_measurement: "NZD/kWh"
        device_class: monetary  
        value_template: "{{ (states('sensor.powershop_daily_charge') | float * 1000) | round(3) }}"

Then I could select the entities in the Energy Dashboard setup:

And it’s all working!

1 Like

New to HA but loving it so far. Does anyone know if there is an integration that scrapes Meridian Energy usage data for the home energy module?

No integration. You have to use multiscrape via HACS and then bring in the data. I could not find anything done already unfortunatly. Note Im only using it to get the powershop daily prices, not my usage. For usage im using a Shelly EM with a 120AMP clamp.

Has anyone found a sensor (i.e. public api or integration) that we could all be using in automations to help protect our power grid (by turning things off) when at peak load?

Allowing our smart homes to automatically respond to situations like this coming up this morning.

Posted same question here.
https://reddit.com/r/SmartHomeNZ/s/MrtdBXzD63

Another kiwi here (dunedin), really like this idea.
Just a little worried about forgetting the sensor on the bottom of the bottle… Hmm.

1 Like

Hi @technikhaus! So far so good, I haven’t lost it yet! I only have one sensor, and when the bottle runs out, I move it over to the other full bottle. Then after I move the sensor, I place an order for another bottle delivery, so they take the empty one and don’t touch the full one with the sensor attached. I also have the LPG level gauge showing on a tablet in our bathroom so I’m always aware of the level (so the shower doesn’t suddently go cold in the middle of the night!) Hopefully this workflow will mean that I don’t lose the sensor.

1 Like

I was chatting with a friend who suggested a good idea, to attach a cable to it (epoxy etc) and bolt that to the slabs where the gas bottles are, long enough to reach both bottles. So if you forget to remove it, it’ll just fall off when they take the bottle away.

Ordered the sensor from your link a couple days ago, and looks like it’s out for delivery today :slight_smile:
A few weeks until we’re allowed back in our house, and I suspect we’ll be on 9KG bottles for a few weeks/months until our driveway is complete, so it’ll be quite handy to have this setup for such small bottles!

Have also ordered everything required to automate the new garage door (Shelly + Zigbee door sensors). Looking forward to setting up all the new automations!

1 Like

Hi All, got my 45kg gas bottle weigh station setup and working in “beta” form :slight_smile: using the excellent video from The Hook Up. At the moment it’s just done using some thick ply wood and roughly put together. Next steps is to fit the NodeMCU into a nice little case and sort all the wiring properly, there is a window directly above the bottles I will be able to wire it up to, so the NodeMCU box can sit inside. Then re-create the base with steel plates and create some sort of cage around the plates… so that the bottle will sit nicely on the top plate and its easy for our friendly RockGas delivery guy to load and unload without needing to explain anything to them. Once that is done and working, I’ll make another one for bottle #2.

Got the template sensors all working via:

  - sensor:
    - name: "Rockgas Bottle 1 Weight"
      unique_id: rockgas_bottle_1_weight
      unit_of_measurement: "g"
      device_class: weight
      state: >
        {{ states('sensor.tasmota_hx711_weightraw') | float - 927 }}
    - name: "Rockgas Bottle 1 Level"
      unique_id: rockgas_bottle_1_level
      unit_of_measurement: "%"
      state: >
        {{ [(((states('sensor.rockgas_bottle_1_weight') | float - 35) / 45) * 100),0] | max  }}

And…

Going to be interesting to see how this works out and then what automations I can run using the data.

Automatically ordering another gas bottle is an obvious one… however the RockGas Tauranga site uses reCAPTCHA on its form. Might be able to use the main Rockgas NZ site form.

Any other ideas?

PS: Once its all working, I’ll add it into the Energy dashboard.

2 Likes

That’s awesome! I was thinking about building something like this as well but decided to go for the Mopeka BLE sensor. It’s working for now, but I think this approach might be better since I wouldn’t need to keep manually moving the sensor onto the other bottle.

I built a level rectangular platform that can fit two gas bottles side by side, so maybe I can add some weight sensors to the platform. Then I could measure the combined weight of both bottles and subtract the weight of the full bottle, instead of measuring each bottle separately. Maybe it could be done with 6 load sensors - 2 on each side, and 2 in the middle.

I also want to build something very similar for our kettle so I can see how much water it has left. (We turn it on automatically in the morning and want to avoid turning it on if it’s empty.) Thanks for sharing that video, this is really helpful!

Would be nice to automate the Rockgas order form. I realized that it takes me less than a minute to fill it out and submit it so I didn’t get around to doing that. I use the main Rockgas NZ site form and that doesn’t look too hard to automate. I might have a look in the next few months when I need to order another bottle.

It would be cool to see a pic of that… still planning what I’m going todo.

How do you avoid temperature-related fluctuations? Do you see the bottle weight fluctuate over the day?

Yes I see temperature-related fluctuations, however have used some rounding to take away all the little changes and currently thinking is that “it’s just a guide” rather than an exact measurement. I mean, before hand it was “feels like the gas bottle is empty”, order another one right? :slight_smile: Plus we have two bottles, so can afford for 1 to completely run out.

We only use gas for hot water and a gas hob and the gas hob uses hardly anything compared to showers and washing machine. So i’m keeping an eye on when those “high usage” things occur and then looking at the temperate fluctuations after that. So far they pretty much even themselves out.

As of today and they have been monitoring for 4 days. Note the Bottle 2 is just using some different calculations to get a % from the same data. So we were at 43%, now at 35.5% - thats about 1.8% per day or a bottle every 55 days… which is kind of about right in our buying cycle.

I have also been thinking I should do manual check by putting the gas bottle on a standard set of scales once a week todo a comparison?

2 Likes

Hey folks! Super nice to meet other enthusiasts from the country. I’m currently based in Auckland.

What a coincidence to see @Greminn’s post on Rockgas! Awesome! I’ve just received my weight sensors and will be turning them into bed occupancy sensors. But the gas project will definitely by my next =]. Also working on a Hyperion installation currently will post progress.

Also if you guys noticed, in 2023.9 a Swedish traffic cam integration was introduced. Got me thinking we should have one too :wink: Waka Kotahi has an API. I’m no dev but putting this out there to gauge interest.

Yes, interested

What a great idea - not much help in the Bay of Plenty were the only cameras are on the Kaimais, but would be great in Auckland or Wellington. They also provide a traffic conditions via API as well, this would be kind of cool to alert on road closures?