FHEM Forum

FHEM => English Corner => Thema gestartet von: kroonen am 07 November 2015, 12:49:53

Titel: esp easy plugin for fhem needed
Beitrag von: kroonen am 07 November 2015, 12:49:53
Hi,

I see this project based on the esp8266 with arduino ide. It supports also already a lot of sensors. Also the are also some home automation where it can push its data to (domoticz, openhab, nodo). Only them is not supported. It should be nice to have it also.

http://www.esp8266.nu/index.php/Main_Page

So if someone can help...

regards Richard
Titel: Antw:esp easy plugin for fhem needed
Beitrag von: AndreasHH am 07 November 2015, 15:54:31
Hi,

You can push over MQTT to FHEM.

http://www.esp8266.nu/forum/viewtopic.php?f=4&t=237 (http://www.esp8266.nu/forum/viewtopic.php?f=4&t=237)

regards Andreas 
Titel: Antw:esp easy plugin for fhem needed
Beitrag von: kroonen am 08 November 2015, 20:52:55
Hi

I tried, that are predefined mqtt plugins. When using the domoticz,I get some values:

start {"idx":2,"nvalue":0,"svalue":"19.96;74.00;0"}
2015-11-08 20:46:52 transmission-state incoming publish received

I get this as value: {"idx":2,"nvalue":0,"svalue":"19.96;74.00;0"}

Is there a way to only get: 19.96 74.00 or T 19.96 H 74.00
Titel: Antw:esp easy plugin for fhem needed
Beitrag von: Klaus0815 am 15 November 2015, 11:09:13
Did ynybody come further in this Topic ?
It can´t be that difficult to Change the code so it sends defined http requests ?
I think it´s not really needed to go the way trough a MQTT Broker ?
Titel: Antw:esp easy plugin for fhem needed
Beitrag von: kroonen am 15 November 2015, 14:43:43
Hi,

When I now choose pidome mqtt,  I get all the values separate pushed.

The question is now how do I get it into sensors/logs etc.

I get this as reading the last value but see the other one come in the same second

start        67.00           2015-11-15         14:37:03

I think this happens, I got 2 sensors on the esp8266 at the i2c bus, bmp180 and si7021 (sht21)

start     1024.3      2015-11-15         14:37:03
start      20.1         2015-11-15         14:37:03
start      20.2      2015-11-15         14:37:03
start      67.0         2015-11-15        14:37:03


I have this in fhem

define mqtt MQTT 127.0.0.1:1883
define mqtt_testtemp MQTT_DEVICE testtemp
attr mqtt_testtemp IODev mqtt
attr mqtt_testtemp stateFormat transmission-state
attr mqtt_testtemp subscribeReading_start fhem/temp


how can I create 2 sensors for this (barometric with temp (bmp180) and a temp/hum sensor?

regards Richard
Titel: Antw:esp easy plugin for fhem needed
Beitrag von: kroonen am 15 November 2015, 14:58:42
I created a log file, and I get this. Now the question how I get it as 2 sensors.

2015-11-15_14:57:02 mqtt_testtemp start: 19.77
2015-11-15_14:57:02 mqtt_testtemp transmission-state: incoming publish received
2015-11-15_14:57:02 mqtt_testtemp start: 1012.83
2015-11-15_14:57:03 mqtt_testtemp transmission-state: incoming publish received
2015-11-15_14:57:03 mqtt_testtemp start: 19.64
2015-11-15_14:57:03 mqtt_testtemp transmission-state: incoming publish received
2015-11-15_14:57:03 mqtt_testtemp start: 67.00
Titel: Antw:esp easy plugin for fhem needed
Beitrag von: kroonen am 15 November 2015, 19:21:48
finally got it working using the pidome mqtt

define mqtt_si7021 MQTT_DEVICE
attr mqtt_si7021 IODev mqtt
attr mqtt_si7021 autoSubscribeReadings /hooks/devices/2/SensorData/+
attr mqtt_si7021 stateFormat Temperatuur: Temperature°C Luchtvochtigheid: Humidity
attr mqtt_si7021 subscribeReading_Humidity /hooks/devices/2/SensorData/Humidity
attr mqtt_si7021 subscribeReading_Temperature /hooks/devices/2/SensorData/Temperature

Titel: Antw:esp easy plugin for fhem needed
Beitrag von: kroonen am 16 November 2015, 20:23:40
I still have one question

I  Want for example not 21.07 but rounded with 1 decimal, 21.1 and for humidity you only 70 and not 70.00

Is this possible with userreadings in fhem??? How can I do this?