Closed BmdOnline closed 3 years ago
When I saw all the new values provided by the url you gave me, I asked myself those questions so we can discuss of it:
Maybe you can add option to specify (when using Teleinformation), if we are using BASE, or HPHC, or Tempo (or detect it using OPTARIF). Another option for Mono or Triphase. This would reduce the data displayed unnecessarily.
I'm not aware of all you need when you use HPHC, Tempo or Triphase, so I'll need help if we want to make this better. But, like it's the same request, it's the same price to get all information, so maybe the best solution if to use a template to get attributes as a sensor : https://www.home-assistant.io/integrations/template/#configuration
Another suggestions would be to provide automation according to HP/HC changes, to Normal/Pointes (tempo).
If it is possible, an event could be triggered when a specific power is raised or exceeded.
In Home-Assistant, the way to do it is to use automation, not integration by itself
In fact, we can do a lot of stuff now... Just imagine them.
Yes indeed, I try on integrate this component as part of Home-Assistant : https://github.com/home-assistant/core/pull/45499 So trying to keep it stable for now since I do it for the ipx800 integration too, but we can still add features.
I was thinking about generate hourly, daily and other statistics, but once again, we should use https://www.home-assistant.io/integrations/statistics/ instead, so I'm currently trying some stuff, that we can integrate to the README
I'm not aware of all you need when you use HPHC, Tempo or Triphase, so I'll need help if we want to make this better.
I can try to help you, but I'm not aware of all specifications. For Teleinformation specifications, you can check this https://www.enedis.fr/sites/default/files/Enedis-NOI-CPT_54E.pdf and this https://www.enedis.fr/sites/default/files/Enedis-NOI-CPT_02E.pdf
But, like it's the same request, it's the same price to get all information, so maybe the best solution if to use a template to get attributes as a sensor : https://www.home-assistant.io/integrations/template/#configuration
Maybe you're right.
Another suggestions would be to provide automation according to HP/HC changes, to Normal/Pointes (tempo). If it is possible, an event could be triggered when a specific power is raised or exceeded.
In Home-Assistant, the way to do it is to use automation, not integration by itself
Other devices I use exposes several entities and several trigger for automation.
For example, a weather sensor exposes temperature, humidity, pressure, wind speed... and we can create automation according to pressure change, temperature change...
Another example is using kodi media player, we can trigger an automation when media player is turned on, off, paused, playing...
In our case, we can trigger an automation on power change only.
I have a standard BASE
subscription (without HP/HC), but I think it may be a good feature to expose current state (HP vs HC...) for automation.
Maybe, instead of exposing only power consumption you can create several entities like power, intensity, current index, type heures, demain... I don't know which items may be a new entity and which ones may be additional data only.
If I can, I will try to do this and try to allow more automation
I was thinking about generate hourly, daily and other statistics, but once again, we should use https://www.home-assistant.io/integrations/statistics/ instead.
I'll have a look.
You can trigger from an attribute now : https://www.home-assistant.io/docs/automation/trigger/#numeric-state-trigger
Maybe I can add checkboxes like : "Add HPHC entity", "Add Tempo entity" and "Add Triphase entities" to add dedicated entites when the user want.
You can trigger from an attribute now : https://www.home-assistant.io/docs/automation/trigger/#numeric-state-trigger
You're right, trigger with attributes works !
I'm currently trying some stuff, that we can integrate to the README
Yes, you can give some examples for automation :
alias: Power alert
description: ''
trigger:
- type: power
platform: device
device_id: b0fe18074b4f1b6ee3bea3dbe8c0d41f
entity_id: sensor.teleinfo_1
domain: sensor
above: 5000
condition: []
action:
- type: turn_on
device_id: d1f4b7c3bdf140128de4c0ac473ee06a
entity_id: light.ikea_bulb_e27_opal_1000lm_9b8c4cfe_level_on_off
domain: light
mode: single
alias: Intensity alert
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.teleinfo_1
attribute: intensite_now
above: 5
condition: []
action:
- type: turn_on
device_id: d1f4b7c3bdf140128de4c0ac473ee06a
entity_id: light.ikea_bulb_e27_opal_1000lm_9b8c4cfe_level_on_off
domain: light
mode: single
alias: Heures Pleines
description: ''
trigger:
- platform: state
entity_id: sensor.teleinfo_1
attribute: type_heures
to: "HP.."
condition: []
action:
- type: turn_on
device_id: d1f4b7c3bdf140128de4c0ac473ee06a
entity_id: light.ikea_bulb_e27_opal_1000lm_9b8c4cfe_level_on_off
domain: light
mode: single
I haven't tested PTEC (type heures) automation, but according to Enedis specification :
La période tarifaire en cours (donnée du groupe d’étiquette « PTEC ») est codée sur 4 caractères ASCII alphanumériques selon la syntaxe suivante : TH.. => Toutes les Heures, HC.. => Heures Creuses, HP.. => Heures Pleines, HN.. => Heures Normales, PM.. => Heures de Pointe Mobile.
Maybe I can add checkboxes like : "Add HPHC entity", "Add Tempo entity" and "Add Triphase entities" to add dedicated entites when the user want.
Finally, you don't have to change anything, since we can really automate everything as it is.
I was thinking about generate hourly, daily and other statistics, but once again, we should use https://www.home-assistant.io/integrations/statistics/ instead,
For now, I'm not really satisfied with hass statistics and history. I have to work on the subject.
One last thing (maybe related to pyecodevices). You're reporting some numeric values as numeric, and other as string :
type_heures: TH..
souscription: '30'
intensite_max: 090
intensite_max_ph1: '0'
intensite_max_ph2: '0'
intensite_max_ph3: '0'
intensite_now: '005'
intensite_now_ph1: '0'
intensite_now_ph2: '0'
intensite_now_ph3: '0'
numero_compteur: 012345678901 (number changed for privacy)
option_tarifaire: BASE
index_base: 012345678 (number changed for privacy)
index_heures_creuses: '0'
index_heures_pleines: '0'
index_heures_normales: '0'
index_heures_pointes: '0'
preavis_heures_pointes: '0'
groupe_horaire: A
etat: '000000'
unit_of_measurement: VA
friendly_name: Compteur Linky
icon: 'mdi:flash'
device_class: power
One last thing (maybe related to pyecodevices). You're reporting some numeric values as numeric, and other as string :
Indeed, but i'm not sure it's a good idea to force type, because I don't control what is send by the ecodevices/teleinfo and I probably get errors.
Maybe it's better to cast in Home Assistant like:
"{{ state_attr('sensor.teleinfo','intensite_now') | int }}"
?
Hi, I did some real tests. It works without type cast.
trigger:
- platform: numeric_state
entity_id: sensor.teleinfo_1
attribute: intensite_now
above: '3'
And it works using value_template and type cast :
alias: Attribute automation
description: ''
trigger:
- platform: numeric_state
entity_id: sensor.teleinfo_1
value_template: '{{ state_attr(''sensor.teleinfo_1'', ''intensite_now'') | int }}'
above: '3'
Or
trigger:
- platform: numeric_state
entity_id: sensor.teleinfo_1
value_template: '{{ state.attributes.intensite_now | int }}'
above: '3'
We can do anything we want, without changing anything to your libraries. So, it seems to be perfect as it.
Thanks again for you help.
It's an advantage of python (and sometimes a disadvantage), it's not strict on types :)
Hi, Starting with version 2.1.0, we have a lot of informations grabbed by the ecodevices component. I'm a newbie with HomeAssistant, so I don't know if ideas below are realistic.
Maybe you can add option to specify (when using Teleinformation), if we are using BASE, or HPHC, or Tempo (or detect it using OPTARIF). Another option for Mono or Triphase. This would reduce the data displayed unnecessarily.
Another suggestions would be to provide automation according to HP/HC changes, to Normal/Pointes (tempo).
If it is possible, an event could be triggered when a specific power is raised or exceeded.
In fact, we can do a lot of stuff now... Just imagine them.
Tell me what you thing about these suggestions. Which is realistic or not.
Thanks.