Code Monkey home page Code Monkey logo

s0tool's Introduction

huizebruin GitHub stats
Top Langs

Twitter Follow
ko-fi

s0tool's People

Contributors

bas-val avatar dependabot[bot] avatar github-actions[bot] avatar huizebruin avatar imgbotapp avatar jelmerkk avatar so871 avatar thegabeman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

s0tool's Issues

Support for esp01_1m or esp32dev

Hi,

At this moment I have a own build working setup which I made some years ago and wanted to upgrade to the S0Tool code/interface so I have all the nice sensors and stuff.

But the current hardware is a ESP8266 with board type: esp01_1m.
Alternatively I have esp32 modules available with board type esp32dev.

How can I get the S0tool code running on one of these devices?
I only need the watermeter only configuration.

Thanks in advance,

It looks like there is an issue with the calculation of the total water amount

Hi,

It looks like the calculation of the total amount is wrong. (After updating ESPhome in HA a few days ago)
My usage would be extreme today wich is not the case.
Maybe there is an issue with dots and commas? (look at the different notation between pulserate and usage)
image
image
image

Also if you compare the increasing of "Stand" and "Totaal" it does not equally add up.

Regards, Maarten

Does not work after rebooting

Hi,

I just soldered an wemos d1 with an 5v npn sensor (from aliexpress) black wire to the d2 and blue to ground and brown to 5v. I have no resistor soldered between the brown and black wire at the moment. Because i read that it needs to work without. And it did a few times, and i tested before with the same problem after a few times rebooting. So the led is lighting up when i hold metal for the sensor. But when i look in my home assistant "water sensor status" stays off. That's why it is not registrering any water usage. The strange thing is it did work like this. My network is also saying that is online, but not giving any usage back in my home assistant.

add initial meter total in ESPhome

Could you add the option to set the initial water meter value from the meter itself into your code?

i used the code below and it works fine.

`number:

  • name: Initiële meterstand m3
    platform: template
    id: initial_water_value
    device_class: water
    min_value: 0
    max_value: 100000
    step: 0.001
    entity_category: config
    icon: mdi:water
    unit_of_measurement: "m³"
    set_action:
    • lambda: id(total_water_pulses) = x * 1000;`

sensor.totaal_opgebracht indicates higher then normal during higher pulsrates.

Hi,
I have noticed that 'sensor.totaal_opgebracht' and related sensor readings per hour/day/week are not correct (too high) during higher power consumption (higher pulsrate).
However, the readings for the 'sensor.actuele_meterstand' are accurate and correct.
Do you have any idea why or solution for this?

Thanks

Capture

Help with Maddalena CD One TRP

Hello,
i hope someone could help me and this is the correct way to post:

I have the Maddalena CD One TRP water meter and i have bought this sensor from Aliexpress:

https://it.aliexpress.com/item/32582384960.html?spm=a2g0o.new_account_index.0.0.7b6825b9A0W8v0&gatewayAdapt=glo2ita

I have installed and configured everything correctly infact the sensor works well when i try with a magnet but if i put on the water meter won't work... do you have some suggestion on how i can test if my water meter magnet work well?

I have seen form the Maddalena website that my water meter is compatible with this sensor:

https://www.maddalena.it/prodotto/reed-switch-trp-one/#form-product

I hope in you reply
Bye
Stefano

How to update manually via EspHome

Hi,
I am using the s0tool solely as watermeter. It works well, I am very happy with it.
I made a few adjustments to the entity names when first flashing the s0tool via Esphome.
What are the steps of performing updates to my s0tool?

Which file of the repo should I use (and adjust it to my entity names)?
Thanks!

Below my current yaml, but I would like to incorporate the energy dashboard feature.

# Delen en bewerken mag maar laat deze eerste regels staan.
# Bron : https://www.huizebruin.nl
# Bron File : https://github.com/huizebruin/s0tool/tree/main/esphome
# © Huizebruin.nl
substitutions:
  vdate: "v22.08.15"
  device_description: watermeter (s0tool) gemaakt door huizebruin.nl versie ${vdate} .
  name: s0tool

esphome:
  name: ${name}
  platform: ESP8266
  board: d1_mini
  comment: '${device_description}'
  project:
    name: huizebruin.${name}
    version: "${vdate}"
  
dashboard_import:
  package_import_url: github://huizebruin/s0tool/esphome/watermeter.yaml

improv_serial:
  
wifi:
# secrets rechts boven binnen esphome (vanaf versie 2021.12.0 - 11th standaard in de secrets)
  networks:
    - ssid: !secret wifi_ssid
      password: !secret wifi_password
  fast_connect: true
  use_address: s0tool.local
  domain: ".local"
#------------------------##------------------------##------------------------##------------------------#
# ⬇ Hieronder niets veranderen tenzij je het overal goed aanpast ⬇ #
# ⬇ Schakel fallback-hotspot (captive portal) in voor het geval de wifi-verbinding mislukt ⬇ #
  ap:
    ssid: "${name}"

web_server:
  port: 80
  
captive_portal:
# ⬇ Enable logging ⬇ # 
logger:
  level: INFO
  
#  # ⬇ Enable Home Assistant API ⬇ # 
api:
  services:
    - service: meterstand_water
      variables:
        meter_value: int 
      then:
        - globals.set:
            id: totalWaterUsage
            value: !lambda "return ( meter_value ) ;"

globals:
  - id: totalWaterUsage
    type: int 
# ⬇ Bij het updaten onder de waarde, verander dit in no voor 1 run  ⬇ # 
    restore_value: no      
# ⬇ Bij het flashen,pas dit aan! ⬇ #        
    initial_value: '201' 

ota:
  safe_mode: true
  reboot_timeout: 10min
  num_attempts: 5

#  ⬇ Enable time component voor reset elke nacht ⬇ #
time:
  - platform: homeassistant
    id: time_homeassistant
    on_time_sync:
      - component.update: S0tool_uptime_timestamp

sensor:
#------------------------# Watermeter #------------------------#
# ⬇ watermeter pulsen ⬇ #
  - platform: pulse_counter
    pin: D2
    id: watermeter_pulse
    name: "watermeter pulse"
    state_class: measurement
    accuracy_decimals: 1

# ⬇ Totaal watermeter ⬇ #      
    total:
      id: sensor_pulse_meter_total
      name: "watermeter Totaal"
      icon: "mdi:cube-outline"
      state_class: "total_increasing"
      unit_of_measurement: m3
      accuracy_decimals: 3
      filters:
      - multiply: 0.001
      
# ⬇ Watermeter stand bij benadering ⬇ #
  - platform: template
    id: watermeter_total
    name: "watermeter stand"
    state_class: "total_increasing"
    icon: mdi:water
    unit_of_measurement: m3
    accuracy_decimals: 3
    lambda:       
      return id(sensor_pulse_meter_total).state + id(totalWaterUsage);
      
# ⬇ watermeter l/min ⬇ #
  - platform: template
    name: "Water verbruik Liter"
    id: watermeter_flow
    accuracy_decimals: 1
    unit_of_measurement: "l/min"
    icon: "mdi:water"
    lambda: return (id(watermeter_pulse).state);
#------------------------#  sensoren #------------------------#
  - platform: uptime
    id: S0tool_uptime

  - platform: template
    id: S0tool_uptime_timestamp
    name: "online sinds"
    device_class: "timestamp"
    accuracy_decimals: 0
    update_interval: never
    lambda: |-
      static float timestamp = (
        id(time_homeassistant).utcnow().timestamp - id(S0tool_uptime).state
      );
      return timestamp;  

  # WiFi signal
  - platform: wifi_signal
    name: "${name} - WiFi Signal"
    update_interval: 120s  
        
# ⬇ versie verbinding informatie sensoren voor in ha ⬇ #
  - platform: wifi_signal
    name: "${name} - WiFi Signal"
    update_interval: 120s
    
text_sensor:
  - platform: template
    name: "s0tool_versie"
    id: s0tool_versie
    icon: "mdi:label-outline"
    update_interval: 6h
    lambda: |-
      return {"${vdate}"};

  - platform: wifi_info
    ip_address:
      name: IP-adres
      id: s0tool_ip_adres
      icon: mdi:ip-network
    ssid:
      name: Netwerk
      id: s0tool_netwerk
      icon: mdi:access-point-network
    mac_address:
      name: Mac-adres
      id: s0tool_mac_adres
      icon: mdi:folder-key-network-outline

# ⬇ restart button voor de s0tool ⬇ #
button:  
  - platform: restart
    name: "Restart device"

[FR] Add list for water meters

First of I want to say great work with this project! I think that this will come in handy for many users that want to track water usage and so on.
I would like to see a list for water meters support this function. That will make it easier for others to see if they can use this for tracking water usage and then buy the needed components. The list can be implemented if people share their experience and then write if it works or not for their water meter.

How to update

hello

I have versie v23.09.32. and a want to update to V23.04.30
how should I do this without losing the existing data
THANKS
I use Home assistant last Version, and only S0Tools for water ( D2 )

Cyberfilou

sensor sometimes registers usage while there is no water consumption

I'm using your s0tool implementation for measuring my water usage in HA. This is an own build setup, using an ESP32 (wemos) and a standard sensor. The setup was really a breeze, the project is well documented and the integration in HA is perfect.

However, I have problems with the measurement. I've searched on several forums but didn't find the answer. Sometimes, the meter registers high water usage while there is no consumption. I think it is related with the position where the measured metal plate stops. If this is at the sensor, it keeps counting. So I might have a water usage (according the sensor) of 12000 ltr a night.

I'm not sure how the measurement is done. Does it count on "rise-up", "fall-down" or a combined action. The last option (combined) should be the most robust in my opinion.

Am I doing something wrong in this case?

diy watermeter install from https://huizebruin.github.io/s0tool/

S0tool Watermeter | INSTALL | only watermeter
Install S0tool watermeter

na install verschijnt het device niet in ESPHome en visit device:
10:11:15 | [W] | [api.connection:085] | 192.168.178.53: Reading failed: BAD_INDICATOR errno=11

ik vermoed dat het een probleem is met een api key maar geen idee hoe te fixen
het device s0tool-s0-watermeter-d3234e is aanwezig en breikbaar o het netwerk 192.168.178.6

please advise

Pieken in opbrengst / verbruik

unknown

Bovenste is de meting van de print en onderste is de template sensor welke Watt omzet naar kW
Heb helaas nog niet kunnen vinden waar dit momenteel in ligt.
Wie wat weet mag het zeggen.

Change version type

Should i change the version from
V22.11.23 to a other format?

its now
22 means year
11 means month
23 means total of updates from the beginning.

to a version type like
v2.6.23

Major - Ik ga het gebruiken als er een nieuw jaar is, zoals 2022 een 2 zal zijn en 2023 een 3.
.
Minor - Wordt geüpdatet bij grote wijzigingen
.
Micro - Wordt geüpdatet bij kleine wijzigingen zoals een fix

Modifier - zoal "dev", "alpha", "beta", "rc1", enz. Wordt alleen gebruikt bij test systemen.

gebaseerd op https://calver.org

Use internal pull-up/down resistors

Thanks for the great work. I am wondering, instead of using external pull-up/down resistors, wouldn't it be an option to use the esp internal ones?

Pulse Sensor Water OFF

Hello,
thanks a lot for your wonderful project!!!
I have one problem, i have installed the standard version but the Pulse Sensor Water is OFF... how can i turn on?

image

I have connected to D5 and the Kw counter works well.

Thanks a lot
Stefano

When using s0tool/esphome/watermeter.yaml it reports every pulse as 3.6L instead of 1.0L

Hello, I'm using your code for measuring water usage and it works great, and it works well with the update interval as 1s instead of default 60s, but it reports every pulse from sensor as 3.6L instead of 1.0L
I'm sure its a function of reducing the update interval to 1s, I played with the code and when it is set to count pulses over 60s & removed the filter it reports correctly, but you only get updates every minute and the update lag is annoying.
Maybe if the reported value is just divided by 3.6 then it should report the pulse as 1L.
I was also thinking of trying the esphome pulse count - rising_edge option, and triggering as the water meters spinning flag 1st triggers the sensor, as the flag may come around and trigger the sensor but stops there and won't record 1L usage until the flag as passed and the pulse finishes ?
Thanks for all your work.

Different pin configuration

I use a D1 mini V4 esp8266 which has a different pin name. I used a manual config before, but switched to the automated version, now I am looking to where this config needs to go. Some is already there like id, but added just for reference. Looking for the pin definition and possibly the update interval.

esp8266:
board: d1_mini

sensor:

  • platform: pulse_counter
    pin: GPIO2 # D2
    id: watermeter_pulse
    name: "watermeter pulse"
    state_class: measurement
    update_interval: 5s
    accuracy_decimals: 1
    unit_of_measurement: "l/min"
    icon: "mdi:water-pump"

downside of ESP32?

Hello
I'm planning to change the wemos d1 to a wemos d1 ESP32.
The main reason is the wifi performance.
The pins are exactly the same and in yaml I thought I only would need to remove the esp8266 specific and change the pinnumbers to GPIO21.

however here it suggests that more changes are required
#100 (comment)
#125 (comment)
I already have to complete configuration running local without external components.

Am I missing something obvious here? or can I just go ahead and migrate to ESP32.
I think for wemos_d1 esp32 the v5 connection would be exactly the same as for esp8266

Meterstand bijwerken probleem / Update meter reading problem

Als je de meterstand invult en daarna gaat kijken is hij hoger dan je hebt ingevuld.

Dit komt omdat hij de totaal pulsen erbij op telt.


If you fill in the meter reading and then look at it, it is higher than you entered.

This is because he adds the total pulses.

Updated to v22.11.25: Watermeter stand has 4 digits after the comma

I just updated to v22.11.25. At first the watermeter stand went to the default value of 8000, which I didn't set. But after changing it via Services the meterstand has 4 digits after the comma, 1989,5350 for example. It should have 3 I guess.

All values have 4 digits now......
image

yaml errors

First of all, very nice project.
But when i tried to adopt the device in esphome it came back with the message: failed config. See attached screen for details.
Probably i do something wrong but i don't what.

watermeter yaml erros

Sensor watermeter stand

After each restart of the s0tool my watermeter stand goes always back to the following value :201.000m3

how will it keep the last value on a reboot of the sensor.

regards

yves

how to assign static IP address to s0tool

Hi, a noob here just starting with esp home.

I want to give the s0tool a static ip address but where can i do that?
I followed the installation guide but I was not able to change the IP address anywhere.

Thanks for your help.

PS. It can be done in Dutch but in English might reach more people.

Edit:
You will always see... searching your ass off and as soon as you have posted the question you find the answer.

Fixed.

Sensor watermer_totaal too high?

Hi,

Recently I came across your script, awesome project!
So I ditched my old selfmade config, which didn't integrate with the Energy dashboard anyway. But it was functional.
As hardware I have an ESP8266 with NPN sensor

To track my daily water usage I have a custom utility meter in configuration.yaml:

utility_meter:
  waterverbruik_per_dag:
    #source: sensor.watermeter_totaal
    source: sensor.watermeter_pulses_totaal
    cycle: daily

As source I tried using the watermer_totaal, but those values seems to be too high.
It also increases while there is no water usage, 100-150 liter last night is almost more than my real usage during the whole day.
Since I use sensor.watermeter_pulses_totaal as source it is accurate again.

So there is a big difference in values.
My daily meter is currently: 36 liter vs 129 liter from the watermeter_totaal sensor. Since the HA Energy dashboard is also using the totaal_sensor as source the values there are also way too high.
Okay one sensor is in liters, the other in m³, but that shouldn't cause a 3.5 times bigger value. Unless 100 liter isn't 0.1 m³ anymore :)

The sensor.watermeter_stand looks very accurate.

ESPHome update issue - "Pin 4 is used in multiple places"

After updating ESPHome to 2023.12.0 I get following compile error:

INFO Reading configuration /config/esphome/s0tool-watermeter-ad280f.yaml...
INFO Updating https://github.com/huizebruin/s0tool/@main
INFO Detected timezone 'Europe/Brussels'
Failed config

sensor.pulse_meter: [source <unicode string>:66]
  
  Pin 4 is used in multiple places.
  platform: pulse_meter
  internal_filter_mode: PULSE
  internal_filter: 50ms
  pin: 
    number: 4
    mode: 
      input: True
      output: False
      open_drain: False
      pullup: False
      pulldown: False
      analog: False
    inverted: False
  id: watermeter_flow
  name: watermeter flow
  state_class: measurement
  unit_of_measurement: l/min
  accuracy_decimals: 1
  icon: mdi:water-pump
  filters: 
    - lambda: !lambda |-
        return x * atof(id(Select_pulse_water).state.c_str()) * 1000;
  total: 
    id: sensor_pulse_meter_total
    name: watermeter Totaal
    state_class: total_increasing
    device_class: water
    icon: mdi:water
    unit_of_measurement: m³
    accuracy_decimals: 3
    filters: 
      - multiply: 0.001
    disabled_by_default: False
    force_update: False
  disabled_by_default: False
  force_update: False
  timeout: 5min
binary_sensor.gpio: [source <unicode string>:50]
  
  Pin 4 is used in multiple places.
  platform: gpio
  id: water_sensor_status
  name: Water sensor status
  internal: False
  pin: 
    number: 4
    inverted: True
    mode: 
      input: True
      output: False
      open_drain: False
      pullup: False
      pulldown: False
      analog: False
  on_press: 
    - then: 
        - lambda: !lambda |-
            id(total_water_pulses) += 1;
  disabled_by_default: False```

Wemos D1 mini pro CP2104 not able to flash s0tool

Not able to flash s0tool to my wemos D1 mini pro CP2104.
I can flash everything else on the wemos (e.g. WLED, Tasmota etc.)
I am not able to flash s0tool via the browser or via Home Assistant.
Is there any other way to flash s0tool?

Blueprint does not work for watermeter

I am using the water-only version of S0 Tool, installed through the button here. In generates this sensor: sensor.s0tool_watermeter_versie

The Blueprint referenced on this page compares another sensor:

- condition: template
    value_template: |-
      {{
                states('sensor.s0tool_versie_github')
                !=
                states('sensor.s0tool_versie')
              }}

Are you able to create a separate blueprint for the watermeter?

How to install gasenwater

Hello,
can you please provide information on how to set up gas and water measurement.

Thank you very much for your support.

Measuring two water meters with one ESP

Hello,

I have two separate water meters for hot and cold water, as it is usual in apartment house. I wonder if it is possible to read both with only one ESP.

Thank you in advance

changing port and board

Hello,

i want to flash my nodemcuv2 with a watermeter connected to port D6
but i cant change the board and port nr
i have forked the github and give it a try but he want still connect to your github

Meterstand werkt niet bij

Ik heb de meterstand via de service aangepast naar wat op de meter staat, hij telt wel de sensor die bij reboot terug naar 0 gaat maar die meterstand telt niet op.
Geen idee wat ik fout doe, heb hem pas geupdate en ervoor werkte dit altijd goed.
Ik heb de Itron watermeter.
IMG_0607

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.