Home Assistant - New Zealand

Mopeka Standard Check BLE Sensor — ESPHome or Mopeka Pro Check BLE Sensor — ESPHome or Mopeka - Home Assistant. I haven’t checked their price or availability in NZ.

There are a few vids floating about of using a load cell to keep an eye on it HX711 Load Cell Amplifier — ESPHome

1 Like

Oh cool, thanks! It looks like I want some mopeka sensors. Not sure where to find ones for the 45kg tanks though, will do some more research!

One thought, you better remember to take them off before they take the tank away. Another automation :slight_smile:

Haha yeah I was just thinking about that too. Maybe attach it to something on the ground with a chain

1 Like

Hi Nathan, I guess you may already have a solution for the gas bottle weighing. If not, i seem
to remember seeing that the gas bottle selector valve has a lever which the pressure differential flips over when changing supply bottle. Could you attach a microswitch to this lever and use the signal?
Just wondering…
Keep tinkering regards
Dangerousdave.

1 Like

Hi David, yes we do have a gas bottle selector that switches over to the next bottle. I was also thinking about putting a Zigbee door/window sensor on it and tracking the open/closed state in Home Assistant. But in the end I decided to buy a “Lippert Bottlecheck Bluetooth GAS Gauge Single” from RV Super Centre. It just arrived a few days ago and I haven’t set it up yet, but it will also be nice to check the level of the gas bottle and see how much we are using each day, etc.

I just decided to get one, and will swap it over to the other gas bottle when one runs out. We only replace one bottle at a time, so hopefully I won’t lose it

Back when we had gas bottles in Auckland I was tinkering with load sensors and trying to weigh the bottles to determine home much was in the tank. I got some progress but then we moved down south with no more gas…

1 Like

I finally got the bluetooth gas bottle sensor working. I got the “Lippert Bottlecheck Bluetooth GAS Gauge Single” from RV Super Center.

It was actually a bit of a mission and ended up taking most of the afternoon and evening. Our gas bottles were on a slight slope and the sensor complains if it’s not level, so I used an old monitor stand with 4 adjustable feet.

It also complains if the gas bottle is sitting directly on a flat surface (something to do with the ultrasonic sensor), so I used a few bits of wood to give it some more clearance. I was getting errors and 0-1 stars for quality until I leveled it properly.

Then I installed ESPHome on a ESP32 NodeMCU development board, and set up the Mopeka Pro Check BLE Sensor integration. The range is pretty decent, I was able to plug it into a socket about 8 meters away through a wall and it picks up the BLE signals.

Then set up a dashboard and some template sensors:

I set up utility meters to track daily/weekly/monthly usage, average daily usage over the last 14 days, and estimated days remaining.

I set up some notifications when the level falls below a certain level.

Will have to test it and see how the sensor works next time a gas bottle runs out.

Here’s the YAML I used for the sensors. Has some hard-coded values where I’m estimating that a new bottle has ~66L of gas and a level of ~750mm.

sensor:
  - platform: template
    sensors:
      total_lpg_use:
        friendly_name: 'Total LPG Use'
        entity_id:
          - sensor.garage_gas_bottle_receiver_lpg_bottle_sensor_distance
        unit_of_measurement: "L"
        value_template: >
          {% if has_value('sensor.garage_gas_bottle_receiver_lpg_bottle_sensor_distance') %}
            {{ ((1 - ((states('sensor.garage_gas_bottle_receiver_lpg_bottle_sensor_distance') | float) / 750.0)) * 66) | round(2) }}
          {% endif %}

      lpg_remaining:
        friendly_name: 'LPG Remaining'
        entity_id:
          - sensor.total_lpg_use
        unit_of_measurement: "L"
        value_template: >
          {% if has_value('sensor.total_lpg_use') %}
            {{ (66.0 - (states('sensor.total_lpg_use') | float)) | round(2) }}
          {% endif %}

      lpg_days_remaining:
        friendly_name: 'LPG Days Remaining'
        entity_id:
          - sensor.garage_gas_bottle_receiver_lpg_bottle_sensor_distance
        unit_of_measurement: "days"
        value_template: >
          {% if has_value('sensor.lpg_remaining') and has_value('sensor.average_daily_lpg_use') and states('sensor.average_daily_lpg_use') > 0 %}
            {{ ((states('sensor.lpg_remaining') | float) / (states('sensor.average_daily_lpg_use') | float)) | round(2) }}
          {% endif %}

  - platform: statistics
    name: "Average Daily LPG Use"
    entity_id: sensor.daily_lpg_use_maximum
    state_characteristic: mean
    max_age:
      days: 14

utility_meter:
  daily_lpg_use:
    source: sensor.total_lpg_use
    name: Daily LPG Use
    cycle: daily
  weekly_lpg_use:
    source: sensor.total_lpg_use
    name: Weekly LPG Use
    cycle: weekly
  monthly_lpg_use:
    source: sensor.total_lpg_use
    name: Monthly LPG Use
    cycle: monthly

template:
  - trigger:
      - platform: time
        at: "23:59:59"
    sensor:
      - name: "Daily LPG Use Maximum"
        state: "{{ states('sensor.daily_lpg_use') }}"

Now I just need to write a script that automatically fills out and submits the order form: Order Online - Rockgas
Maybe later!

2 Likes

Like you I have the same gas setup (Rockgas as well), and have thought about monitoring them - dont you have to manually change the sensor over to the bottom of the bottle every change?

FYI - I live in TGA and have all of our lights (Hue and Nanoleaf), Zigbee and Thread via SkyConnect, Z-Wave via USB stick, some Shelly stuff and a BT proxy. All of our internal and external lights, exterior doors are controlled via automations etc. I use a lot of timers in rooms with monitoring via hue motion sensors. Starting to get into ESPHome now and been using HAOS for about a year. I like the “if ute is home and ive forgotten to lock it, lock it at night” automation :slight_smile:

We are all apple users here, so using homekit to trigger a helper in HA when we leave the house etc. This has been absolutely rock sold for home presence detection.

Things I want todo:

  • Add data from met service somehow (has anyone done this?)
  • Add bed occupancy to our master bed for lighting and heating control
  • As above, monitor gas bottle usage and automate re-ordering
  • Automate shower extractor fans with humidity sensors
  • Install power monitoring (have been thinking of a couple of Shelly 4PMs)
  • Monitor water usage

Last time I looked they were pretty stingy on providing an api. Like, they didn’t.

Playing with HACS multiscrape :slight_smile:

Yes I had a look and spotted an API which seemed to relate to ocean data.

Care to share? I am not a big fan of scraping.

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.

4 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!

2 Likes

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.