claudegel / sinope-130

Neviweb130 custom component for Home Assistant to manage devices connected via a GT130 and wifi devices from Sinopé
GNU General Public License v3.0
67 stars 15 forks source link

Control setpoint from sinope-130 #106

Open tracedebrake opened 1 year ago

tracedebrake commented 1 year ago

Hello @claudegel,

Is there a way to increase or decrease thermostats setpoints by using sinope-130? I can see the setpoint as a state attribute (''temperature:'') field but I don't see any Neviweb service that could change a setpoint.

My goal would be to bypass the Sinopé Neviweb app for all automatisations, such as decreasing thermostats temperature during the night and increasing them next morning by using Home Assistant only.

Thank you very much for all your work.

claudegel commented 1 year ago

Hi, it is pretty easy with the service climate.set_temperature. Here is an exemple:

###########################
##       alumer plancher cuisine a 8:00 AM en semaine
###########################
  - alias: chauffe cuisine matin
    initial_state: true
    trigger:
      platform: time
      at: "08:00:00"
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: binary_sensor.workday_sensor
          state: 'on'
        - condition: or
          conditions:
          - condition: state
            entity_id: sensor.season
            state: 'winter'
          - condition: numeric_state
            entity_id: sensor.dark_sky_temperature
#            entity_id: sensor.owm_temperature
            below: 3.0  
    action:
      service: climate.set_temperature
      entity_id: climate.neviweb130_climate_plancher_cuisin
      data:
        temperature: 21

I don't use neviweb automation as HA is a lot more powerfull. The exemple above is done the old way with manual coding in automation.py but an easier way is to install scheduler-component with HACS. This nice component will allow you to do all your dream in automation the easy way. Let me know if you need help

claudegel commented 1 year ago

By the way it is not a neviweb service but a native HA service, climate.set_temperature

tracedebrake commented 1 year ago

You're right, I see that I can pick the HA climate.set_temperature service in conjonction with the climate.neviweb130.* entities. Amazing. Used it already to control a non-smart Fujitsu heatpump using a Wi-Fi to IR/RF bridge with the SmartIR integration.

My goal is also to use the hydroqc.ca HA addon and use the various winter credit sensors to trigger various automatisations based on timestamps. Didn't find yet how to use the timestamp (yyyy-mm-dd hh:mm:ss.) format to trigger automatisations.

claudegel commented 1 year ago

For the winter credit I catch directly the email that Hydro is sendingthe day before and HA is able to extract the peak period. I've posted all the informations in this blog: https://community.home-assistant.io/t/sinope-line-voltage-thermostats/17157/824 You just need to set your Rpi to be able to read your email and HA will monitor for an email from hydro then read it to extract peak period and set your system ready for the peak period the next day. If you have one devices set in Eco Sinopé you can also catch the signal that Neviweb send to that devices and set all your other devices to act for the peak period. This is explained in the read.me file for the neviweb130 in my git What is the hydroqc.ca addon. The one I know just give consumption data

tracedebrake commented 1 year ago

Take a look at it here https://hydroqc.ca/docs/reference/sensors/

You can use a bunch of sensors: https://hydroqc.ca/docs/reference/wc-sensors/

And do advanced routines that do not only take into consideration ''peak'' periods but also ''anchor'' periods to maximize your winter credit return: https://hydroqc.ca/docs/winter-credits/optimization-logics/

For exemple, their ''sensor.hydroqc_maison_next_critical_peak_start'' entity return a timestamp. Not sure yet how to start an automatisation from a timestamp, just started in HA 2 weeks ago.

claudegel commented 1 year ago

OK let me check this. Look very interesting. I'll tell you how to decode the timestamp to set your automation at the wright time

claudegel commented 1 year ago

In fact I had this installed long time ago at the beginning but there was nothing about peak period. Now when I start it i get an error: ERROR - pyhydroquebec - Exception in http_request I think I'll reinstall everything to be sure

claudegel commented 1 year ago

There should be something wrong I get this error pyhydroquebec.error.PyHydroQuebecHTTPError: Error Fetching https://cl-ec-spring.hydroquebec.com/portail/fr/group/clientele/portrait-de-consommation/resourceObtenirDonneesPeriodesConsommation

tracedebrake commented 1 year ago

pyhydroquebec and hydroqc are two different projects; you should remove pyhydroquebec since hydroqc is way more complete.

I installed hydroqc by the HA Addons menu; added their custom repository (https://gitlab.com/hydroqc/hydroqc-hass-addons) and configured it directly by the Hydroqc Add-on configuration tab. A lot of account parameters need to be entered, you must have one of your online bill opened to gather all the information needed such as the client number, account number and contract number.

Exemple of hydroqc sensors in my HA dashboard image

claudegel commented 1 year ago

OK I've lots of sensors: sensor.hydroquebec... sensor.hydroqc...

but sensor.hydroqc_maison_next_critical_peak_start is unavailable is it what you have?

tracedebrake commented 1 year ago

According to their doc: ''wc next critical peak start / end: The timestamp for the next critical peak period start and end. Can be used as triggers in home-assistant automations. Will be “Unavailable” when the next peak event is not critical''

However, still in their doc: ''wc next anchor start / end: The timestamp for the next anchor period start and end. Can be used as triggers in home-assistant automations. Will always have a value

But still unavailable; my guess is that it shows ''unavailable'' because the winter credit starts december 1st.

claudegel commented 1 year ago

Sound good. Do you have a timestamp value somewhere? I can start to work on extracting date and time from it to find the exact peak period start. On my side sensor.hydroqc_maison_next_anchor_start is unavailable

tracedebrake commented 1 year ago

Lot of answers in their Discord channel (browser compatible, no need to register for read-only): https://discord.com/invite/BTPDntfaXH

Just found out a post that confirms ''unavailable'' timestamp entities will work december 1st

I asked about the timestamp format and it's an Home Assistant standard: https://developers.home-assistant.io/docs/core/entity/sensor/#available-device-classes

They have a demo blueprint here: https://gitlab.com/hydroqc/hass-blueprint-hydroqc/-/blob/main/hydroqc-winter-credits.yaml

And it seems that we can simply use Trigger IDs from that blueprint to trigger automatisations.

image

Making more sense.

Edit 2022-11-04 11:20: You can add their blueprint to your HA with this link: https://my.home-assistant.io/redirect/blueprint_import/?blueprint_url=https%3A%2F%2Fraw.githubusercontent.com%2Fhydroqc%2Fhass-blueprint-hydroqc%2Fmain%2Fhydroqc-winter-credits.yaml

image

claudegel commented 1 year ago

Thank's lot of reading this weekend

tracedebrake commented 1 year ago

Everything is set on my end, ready for winter 22-23 :)

Nice hydroqc, sinope-130 and SmartIR mix.

tracedebrake commented 1 year ago

Their blueprint is toast, doesn't work properly, ask for optional fields.

This is two exemples how I used their entities for my automatisations:

image

image

tracedebrake commented 1 year ago

image

Everything went fine here! :) How it went for you? (33.53kWh/35.07kWh) = 95.6% energy reduction during the afternoon peak :)

By the way, do you know if we can live monitor the FS4220 Flow sensor (plugged into a ZigBee Sedna)?

I would like to program an ''away from home'' mode: if activated and if the flow goes higher than 2L/min, shutoff the valve automatically.

claudegel commented 1 year ago

Very good score. better then me. I only got 16.78$ because my reference energy is too low, 10.7 kw in the morning and 30 for the evening. I can push to save 2 more kw for each peak but it will give me only 2$ more. I need to increase my reference by switching everything during the reference period.

For you valve. you have the Water_leak_status attribute that turn on if the meeter detect a leak. to find out how much water is measured it is via the attributes: 'hourly_flow_count' 'daily_flow_count' 'monthly_flow_count' 'hourly_flow' 'daily_flow' 'monthly_flow' But these values are updated once per hour. In neviweb130, they are converted in cubic meter to be compatible with the HA energy module.

tracedebrake commented 1 year ago

But if I do not use the GT130 gateway/Neviweb and I add the Zigbee valve directly with ZHA, there should be a way to extract the live sensor data?

What I do to increase my energy consomption is that I preheat the house only during critical anchor periods and only by using baseboard heating. All winter I heat using heatpumps so my energy usage is very low but then during critical anchor periods I switch to basebord only and push to temp up to 23degC.

I follow this logic:

image

claudegel commented 1 year ago

Data for water metering is passed by the same cluster as for the energy usage for the other devices. 0x0702 0x0000 CurrentSummationDelivered watt/hr But for the valve the value are L/hr

tracedebrake commented 1 year ago

The big question is if the data is pushed out faster from the valve than once per hour, or it logs for an hour then push out.

If it pushes like once per minute or per second I could just divide that L/hr value by 60 to get L/min or by 3600 to get L/sec.

image

It should be able to detect a flow as low as 2L/min, which is 33mL/sec.

claudegel commented 1 year ago

The valve will automatically shut down if there is a small leak and switch the Water_leak_status attribute to «water»

claudegel commented 1 year ago

As the zigbee device are design for low energy concumption then I suspect that it will send only once per hour. But you can monitor that output to find out if it change avery minutes or every hour. In neviweb130 the hourly_flow attributes is monitored every 30 minutes but you can change the frequency on line 750 in switch.py. Maybe I should set that as a parameter to be adjusted in configuration.yaml

tracedebrake commented 1 year ago

Is Water_leak_status a neviweb130 entity? Does it trigger from leak detectors or from the flow?

If it's from the flow, do you know its trigger value? (L/min?)

claudegel commented 1 year ago

Water_leak_status is triggered by the valve equipped with a flow meter. It is an attribute for your valve. It is possible that you have to activate it in Neviweb under your valve configuration.

claudegel commented 1 year ago

The trigger value is 2L/min for the 3/4 in and 4 L/min for the 1 in flow meter as I can see form Sinopé

claudegel commented 1 year ago

Look like there are many parameters adjustable for the flow meter in neviweb. If you have one with a sedna second gen then we can chack and add thoses parameters in HA with a service to be able to change them. If you have time

tracedebrake commented 1 year ago

https://support.sinopetech.com/en/neviweb/2.1.5.4.1/

*Duration of abnormal flow before alert This parameter allows to select the duration of abnormal flow tolerated before the alert is triggered. (e.g.: filling a swimming pool, watering the lawn)**

The minimum is 15 minutes.

That's way too high. That means that if no leak detectors capture water, the house will be flooded for 15 minutes before ''Water_leak_status'' turns to ''water''.

The idea is to set an ''away mode'' where the flow meter can capture the smallest flow possible which automatically means a leak since there's nobody home.

claudegel commented 1 year ago

can you pull the parameter available with the time values so I can add them in neviweb130. Open a debug console with F12 when your in the valve config to get all parameters and if there are a drop down menu for thos parameters give me the value availables.

claudegel commented 1 year ago

I'm testing my stat_interval parameter now and will create a branch for testing

tracedebrake commented 1 year ago

I do not have the valve yet; I ordered everything (valve 3/4 zigbee, flow meter 3/4 and a dozen detectors) at the boxing day sale; should receive everything in the 1st week of january.

Just trying to understand how I'll setup this in HA prior to installation. That 15 minutes trigger setting is way too high; this is why I opted for the zigbee version in case I can retrieve the data faster than from Neviweb.

claudegel commented 1 year ago

A major leak should be catch by your leak sensor so the meter is there to detect small leak which won't do much dammage in 15 minutes

claudegel commented 1 year ago

Once you have them we will see if the values are updated more frequently. To find out you can check any hourly_kwh status of thermostat or switch you have already connected. When heating the hourly_kwh will increase during the hour. But for that we will need my stat_interval param which is almost ready

tracedebrake commented 1 year ago

Ok.

It happened to me once. Water goes where gravity direct it to go and if a detector isn't exactly in the way, they are simply useless.

A 2L/min leak can easily ruin that dining room hard floor. Over 30,000$ in insurance claim.

claudegel commented 1 year ago

OK my stat_interval config work so I'll make a new branch stat-intervall. I'll let you know when it is ready to test

claudegel commented 1 year ago

See https://github.com/claudegel/sinope-130/blob/stat-intervall branch if you want to test stat_interval

tracedebrake commented 1 year ago

I get a 404.

image

claudegel commented 1 year ago

Oups,

https://github.com/claudegel/sinope-130/tree/stat-intervall

claudegel commented 1 year ago

Look like those parameter will be availables from neviweb "alarm1FlowThreshold", "alarm1Length", "alarm1Period", "alarm1Options"

tracedebrake commented 1 year ago

Interessing.

It'll tell you once my Sedna kit is installed. Should be around mid-january at last but hopefully sooner.

tracedebrake commented 1 year ago

Hello @claudegel,

We had a critical peak yesterday, went all fine:

image

Concerning the Sedna, I finally received my kit yesterday. It took Sinopé a long time to ship all the boxing day orders they had.

I saw that you pushed an update to improve the Sedna valve; I'll tell you once the kit is installed so we could test a few thing to trigger an event based on the minimal flow rate (2L/min).

claudegel commented 1 year ago

Good I only got 5$ because my reference value is half of yours. One of my heatpump have a proble with an electronic card and it start over heating the room at anytime. Waiting for the part to be installed on February 02. Once you get everything install let me know