flukso on home assistant

home assistant and fluko!?
how can we do it?

gebhardm's picture

MQTT and Node-Red?

neomarcio's picture

i ,not a good at this things,can you explain how to do it!

gebhardm's picture

Well, firstly describe your requirement more in detail; there are so many home assistant and home automation systems out there, you will not be able to count. As such you just asked "how can I see the moon" and I answered "open your eyes"...
Well, secondly, the Flukso is a MQTT broker and publishes its readings by a bunch of MQTT messages; these may be used by "a" home assistant for whatever, if it is able to "understand" it. For understanding most likely the sent messages need to be reformatted; and such can easily be done using Node-RED.
Well, thirdly, "being not good at something" is no excuse, but should raise the wish to get better; and as such not only G**gle is your friend...

neomarcio's picture

well spoken,i not an expert on this kind of things,i´m taking the 1º steps on this kind of things,i have purchase a fluko device to measure my eletric bill and "G**gle" a video of HOMEASSISTANT!!! so i followed the instructions and install (hass.io) on a raspeberry pi 3,and i thought if i can see my flukso devise on my home assistant....well ...i...G**gle..it again and i find this(https://github.com/flukso/hass_flukso_component)...but i do every thing that i think i understand,but it doesn`t work!!!???
so my turn my thoughts to my account of flukso,trying to get help from the persons that realy understand...this things.
sorry for my english...i am portuguese,can you hel me?

gebhardm's picture

As it seem the flukso/hass-component does not comply to the latest Home Assistant installation. So, what remains is either addressing the repo owner by issue or find out yourself what needs to be changed...

20-05-26 06:40:58 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/flukso/hass_flukso_component repository
20-05-26 06:41:00 ERROR (MainThread) [supervisor.utils.json] Can't read json from /data/addons/git/cffceb59/repository.json: [Errno 2] No such file or directory: '/data/addons/git/cffceb59/repository.json'
20-05-26 06:41:00 WARNING (MainThread) [supervisor.store.data] Can't read repository information from /data/addons/git/cffceb59/repository.json

gebhardm's picture

Note: Just did some crawling through the repo; the flukso add-on works with FLM03 only; it does not recognize FLM02 configurations, thus does not work with it without adaptations.

neomarcio's picture

well mine is that FLM02

tld's picture

neomarcio: What I did was point the HA mqtt to my model FLM02B flukso box

in the HA configuration.yaml file

mqtt:
broker: [ip address of your flukso box]
port: [mqtt port on flukso box, default 1883?]

sensor:
-platform: mqtt
name: "[whatever you want to call your sensor]"
state_topic: "/sensor/[flukso sensor id]/gauge"
unit_of_measurement: "W"
value_template: '{{ value_json[1] }}'

--

the rest you will have to figure out yourself, I did this ages ago so I don't remember where I found it, you can create extra sensor entries for additional flukso sensors, and it might get broken with further HA upgrades

Doing this has limitations, and probably is not the most elegant way to do it, you will need to bridge mqtt servers if needed

tld's picture

I forgot the important bit in the configuration.yaml file

sensor:
- platform: template
sensors:
energy_consumption:
value_template: '{{ "%0.1f"|format(states.sensor.pvoutput.attributes.energy_consumption|float/1000) }}'
friendly_name: 'Consumption'
unit_of_measurement: 'kWh'
energy_generation:
value_template: '{% if is_state_attr("sensor.pvoutput", "energy_generation", "NaN") %}0{% else %}{{ %0.2f"|format(states.sensor.pvoutput.attributes.energy_generation|float/1000) }}{% endif %}'
friendly_name: 'Generated Today'
unit_of_measurement: 'kWh'

gebhardm's picture

@bertouttier - then it would be great to also make it FLM02 compliant :-) I saw that the /device/+/config/sensor topic could rather easily be made compliant providing sensor-id and name=function; the gauges and counters are the same in FLM02 and FLM03. Thanks.

bertouttier's picture

@gebhardm you are probably right. I don't own a FLM02, so I did not get to actually implement it. I am discussing with Bart on this. If you can't wait, feel free to open a PR! :)

KennyBuntinx's picture

Same here - FLM03 and can't get it to work - It complains about the yaml file .
Any help / example with a good configuration.yaml file ?

neomarcio's picture

solution...solution...

bertouttier's picture

@kennybuntinx what is your configuration? It should be as simple as:

  1. flukso:

If there are sensors that you want to ignore:

flukso:
ignore_sensors:
- # water counter
- # gas counter

If you are using the code from my PR (located here, Bart did not get around to merge it yet...), please make sure that you read the README file to know how to set up the MQTT bridge between your HA broker and the Flukso broker.

FLM02 support is not added yet, but for your FLM03 it should work. Let me know.