Welcome to the Athom Community Forum! This is a place to share ideas, ask for help and discuss about Homey in general.

Please read Welcome to the forum to get started.

Watermeter app

Homey_LampjeHomey_Lampje Member
edited March 5 in Developers
I have build my own Homey Watermeter app... My app shows the watermeter its reading in m3 liters, the water flow in l/min and the daily usage in liters. As Homey only supports the capability "meter_water" with units m3 my flow and daily water usage reading showup as m3 liters which they are not... see photos for what I mean.

If someone knows a trick to change this please let me know.



Comments

  • TedTolboomTedTolboom Backer - Geek Edition
    edited March 5
    @Homey_Lampje Nice! Which sensor are you using?

    You can create your own custom capability for "water_flow" and "water_usage".
    I made some additional custom capabilities for the Z-wave Neo Power plug for current and voltage:
    "capabilities": {
    	"measure_current": {
    		"type": "number",
    		"title": {
    			"en": "Current",
    			"nl": "Stroom"
    		},
    		"units": {
    			"en": "A"
    		},
    		"desc": {
    			"en": "Electric current(A)",
    			"nl": "Elektrische stroom (A)"
    		},
    		"chartType": "stepLine",
    		"decimals": 2,
    		"getable": true,
    		"setable": false
    	},
    	"measure_voltage": {
    		"type": "number",
    		"title": {
    			"en": "Voltage",
    			"nl": "Spanning"
    		},
    		"units": {
    			"en": "V"
    		},
    		"desc": {
    			"en": "Voltage (V)",
    			"nl": "Spanning (V)"
    		},
    		"chartType": "stepLine",
    		"decimals": 0,
    		"getable": true,
    		"setable": false
    	}
    },
    
    And define your own mobile card combining these capabilities on one card:

    And the code in app.json:
    "mobile": {
    	"components": [{
    			"id": "icon",
    			"capabilities": ["onoff"]
    		},
    		{
    			"id": "sensor",
    			"capabilities": ["meter_power", "measure_power", "measure_current", "measure_voltage"],
    			"options": {
    				"icons": {
    					"measure_current": "/drivers/NAS-WR01ZE/assets/measure_current.svg",
    					"measure_voltage": "/drivers/NAS-WR01ZE/assets/measure_voltage.svg",
    					"measure_power": "/drivers/NAS-WR01ZE/assets/measure_power.svg"
    				}
    			}
    		},
    		{
    			"id": "toggle",
    			"capabilities": ["onoff"]
    		}
    	]
    
    In the meantime, these capabilities are standardized by Athom, after creating an issue / Pull Request on: https://github.com/athombv/node-homey-lib

    Should work also for the watermeter.
  • @TedTolboom Thanks.

    My watermeter is a Sensus 620 with a pulse sensor (HRI) attached. For every liter of water used the HRI gives me a pulse, which I feed into a Wemos D1 Mini (arduino). In my adruino sketch I do the pulse counting and water flow computation, the result is sent as a kind of "DSMR P1 telegram" to Homey over WiFi. 

    This morning when I woke up I thought wait a minute... custom capabilities... that should do the trick. Well you confirm this great, thanks for the code snippet as well as the link to GitHub. I will go to work right away :-)

  • @TedTolboom that worked out okay... thanks for your help.


  • TedTolboomTedTolboom Backer - Geek Edition
    Nice!.
    Would recommend to add the device icon to increase device recognition; although most houses don't have more than 1 water meter.

    Will be looking into this solution to add an overall energy meter (watched your other topic) as well as water meter to my Homey (without Energylink)  ;)
  • Homey_LampjeHomey_Lampje Member
    edited March 10
    ...."the device icon".... uuuuh, where can I find these Homey device icons? I have changed the waterdrop icon into a "real" watermeter icon, looks great I think. I am still seeking for a better looking icon for "Doorstroming" and "Dagtotaal".


  • TedTolboomTedTolboom Backer - Geek Edition
    You will need to create and define the device icons yourself...
    "images": {
           "large": "/drivers/NAS-PD01ZE/assets/images/large.jpg",
    "small": "/drivers/NAS-PD01ZE/assets/images/small.jpg"
    },
    More info: https://developers.athom.com/library/introduction/

    On the icons; are there standard symbols (like SI) you can add to the current icons like I did with the current, voltage in the example above? A flow symbol for the "Doorstroming" and Sigma for "Dagtotaal"?
  • RamonBaasRamonBaas Backer - Geek Edition
    @TedTolboom You are referring to the JSON for the device images in the app store.

    @Homey_Lampje To add the device icon to a custom mobile card you'll need to add
    "mobile": {
                "components": [
                    {
                        "id": "icon"
                    },
    ...
  • TedTolboomTedTolboom Backer - Geek Edition
    RamonBaas said:
    @TedTolboom You are referring to the JSON for the device images in the app store.
    Damn... still too early on a Sunday morning... you're right.
  • Homey_LampjeHomey_Lampje Member
    edited March 12
    @TedTolboom @RamonBaas both thanks for the clarification... I was wondering where "large.jpg" and "small.jpg" where used for... well that is also clear now.

    Yesterday I played around with the icons... I am satisfied, see below for some screenshot of the app. 








  • Sorry to give this a bump, but did you ever release the app? Or at least published the source files for both ESP8266 and Homey App?

    I have the same setup with HRI pulssensor, would love to use your app.
  • @RNLDNKP I did not... The Homey water app "I made" is a modified version of Ramon Baas his dsmr.p1 Homey app... this means that I at least have to ask Ramon what he thinks of your request. If Ramon is okay I can PM you the files for Homey and Arduino and/or even publish the files "as is" without any support or whatsoever here on the forum.

    @RamonBaas please leave your thoughts...
  • RamonBaasRamonBaas Backer - Geek Edition
    @Homey_Lampje Sure, no problem. As long as I can submit a PR to add support for my Elster PR6.
  • @RamonBaas :-) will do no further development on the water app.... @RNLDNKP sorry.


  • Bummer  :( Looks really nice, you even thought of the 'start value'. Have to figure something out myself then :/
  • @RamonBaas took a closer look at the Elster PR6 datasheet... if this Elster PR6 sensor has an open collector output it should be able to make use of my Arduino sketch... and in that case the Homey Water App will work also for the Elster PR6 without adaptations.

    Suggestion... I provide you (Ramon) with the Water app + ESP8266 sketch you figure out if it works with your Elster PR6 and if it does... please make Ronald @RNLDNKP happy :-)

    Kind regards,
    Peter
  • RamonBaasRamonBaas Backer - Geek Edition
    @Homey_Lampje I use a Arduino nano myself (I prefer to use wired interfaces over wireless). But in the end it is all based on simple pulses.

    Why not just publish your code on GitHub with the explicit mention that it is unsupported (and don't add an issues page)? Then maybe at some point I can fork it.
  • @RamonBaas I did not publish it on GitHub because it is more or less your code (Homey Dutch Smart Meter app)... If you are fine with publishing my Homey Watermeter App on GitHub I can do that. You are fine with me publishing the app on GitHub?
  • RamonBaasRamonBaas Backer - Geek Edition
    @Homey_Lampje Yes, sure.
  • Homey_LampjeHomey_Lampje Member
    edited October 13
    @RamonBaas @RNLDNKP Water App is available on GitHub (no support is given, use at own risk etc etc.).

    https://github.com/PeterEIER/nl.water.hri

    https://github.com/PeterEIER/nl.water.hri.esp8266
  • The hardware... an ESP8266 and open-collector interface (using a 10k pull-up resistor to 3.3VDC). 


  • Man this is awesome! This was so easy to put together and implement. Many thanks you both :) 

    I used an ESP8266 (NodeMCU). For now it's on a breadboard with some jumpers wires and 10K resistor. 
    Even added two leds to indicate a Puls (from HRI) and Data (to Homey). The Data-led also blinks after a reboot telling me it's trying to connect to my Wifi. 

    Whoever owns a Homewizard/Energylink/HRI combo and wants to get rid of it, this is it. Use this (with your HRI) for your water meter and you can use a YouLess for your energy.

  • @rnldnkp

    can you make a picture and a short discription how you managed it. Do i need to load a script in the 8266?

    Thanks in advance

  • @connect the pictures posted by Homey_Lampje show exactly what you need, how to connect and tell what to do. Look at the chip, it's an ESP8266 ;)

    If you do not know how to use an ESP8266 (or Arduino-a-like) I suggest you look in to that first. Will save you (and us) a hell of a job.

    Next you would figure out what a .ino file is, which you might have noticed in the links provided.
  •  Thank you for the explanation.   I have just a little bit Experian's whit the ESP8266 via Domoticz  You mentioned that you did use the ESP8266 (NodeMCU). Whit 2  leds for the pulsing and communication Homey so you have a different unit than Homey_Lampje. I like always when something is visual monitoring so therefore my question about a picture how you did it whit the leds. I will study everything and give it a try the ESP8266 is not so expensive Let you know when I succeeded. Thanks for helping the forum is super.   Greetings Ruud

Sign In or Register to comment.