Neues Modul: ESPEasy [war: ESPEasy ohne MQTT]

Begonnen von dev0, 18 Juli 2016, 11:53:28

Vorheriges Thema - Nächstes Thema

kroonen

Here the output


fhem> version
Latest Revision: 11952

File                Rev   Last Change

fhem.pl             11922 2016-08-08 14:39:02Z rudolfkoenig
90_at.pm            11342 2016-04-29 11:25:51Z rudolfkoenig
98_average.pm       10530 2016-01-16 19:27:21Z rudolfkoenig
98_cloneDummy.pm     5919 2014-05-21 05:03:48Z joachim09876
00_CUL.pm           11637 2016-06-09 18:01:20Z rudolfkoenig
09_CUL_FHTTK.pm      7529 2015-01-11 18:52:43Z matscher
14_CUL_WS.pm        10794 2016-02-11 06:26:06Z rudolfkoenig
No Id found for 71_DENON_AVR.pm
98_dewpoint.pm       6757 2014-10-12 18:58:57Z joachim09876
98_DOIF.pm          11314 2016-04-26 18:29:24Z damian-s
98_dummy.pm         11442 2016-05-15 12:43:12Z rudolfkoenig
93_FHEM2FHEM.pm     11732 2016-07-02 17:41:31Z rudolfkoenig
98_fheminfo.pm      10570 2016-01-19 06:39:23Z rudolfkoenig
01_FHEMWEB.pm       11924 2016-08-08 16:31:21Z rudolfkoenig
11_FHT8V.pm          7115 2014-12-02 06:51:20Z rudolfkoenig
92_FileLog.pm       11921 2016-08-08 08:37:09Z rudolfkoenig
10_FS20.pm          11432 2016-05-12 08:35:57Z rudolfkoenig
98_help.pm          11482 2016-05-19 19:17:31Z betateilchen
02_HTTPSRV.pm       10733 2016-02-06 09:02:02Z borisneubert
98_JsonList2.pm     11764 2016-07-08 09:27:57Z rudolfkoenig
13_KS300.pm         11620 2016-06-05 16:29:46Z rudolfkoenig
30_MilightBridge.pm 11710 2016-06-24 09:07:17Z mattwire
31_MilightDevice.pm 11177 2016-04-03 11:40:34Z markus-m
00_MQTT.pm          10418 2016-01-08 23:28:27Z ntruchsess
10_MQTT_BRIDGE.pm    6935 2014-11-09 20:35:34Z ntruchsess
10_MQTT_DEVICE.pm    6935 2014-11-09 20:35:34Z ntruchsess
91_notify.pm        11178 2016-04-03 14:20:32Z rudolfkoenig
98_PID20.pm         10722 2016-02-04 17:12:18Z john99sr
73_PRESENCE.pm      11810 2016-07-17 18:17:46Z markusbloch
# $Id: 00_SmartMeterP1 michelverbraak $
98_statistics.pm    11309 2016-04-25 17:07:12Z grompo
99_SUNRISE_EL.pm    10569 2016-01-19 06:30:28Z rudolfkoenig
98_SVG.pm           11771 2016-07-09 11:11:48Z rudolfkoenig
42_SYSMON.pm        11105 2016-03-20 19:37:02Z hexenmeister
98_telnet.pm        11789 2016-07-12 13:44:14Z rudolfkoenig
98_UbiquitiMP.pm     8516 2015-05-02 17:14:24Z wzut
98_UbiquitiOut.pm    8471 2015-04-23 17:46:01Z wzut
99_Utils.pm         10570 2016-01-19 06:39:23Z rudolfkoenig
98_version.pm       11026 2016-03-08 07:25:45Z markusbloch
59_Weather.pm       11249 2016-04-16 17:03:47Z borisneubert

Blocking.pm         11918 2016-08-07 16:51:00Z rudolfkoenig
Color.pm            11159 2016-03-30 16:08:06Z justme1968
No Id found for ConnAck.pm
No Id found for Connect.pm
No Id found for Constants.pm
DevIo.pm            11786 2016-07-12 08:44:10Z rudolfkoenig
No Id found for Disconnect.pm
GPUtils.pm           6653 2014-10-02 11:59:37Z ntruchsess
HttpUtils.pm        11935 2016-08-10 09:09:03Z rudolfkoenig
No Id found for JustMessageId.pm
No Id found for Message.pm
No Id found for PingReq.pm
No Id found for PingResp.pm
No Id found for PubAck.pm
No Id found for PubComp.pm
No Id found for Publish.pm
No Id found for PubRec.pm
No Id found for PubRel.pm
RTypes.pm           10476 2016-01-12 21:03:33Z borisneubert
SetExtensions.pm    11513 2016-05-24 17:56:05Z rudolfkoenig
No Id found for SubAck.pm
No Id found for Subscribe.pm
TcpServerUtils.pm   11908 2016-08-06 15:09:55Z rudolfkoenig
No Id found for UnsubAck.pm
No Id found for Unsubscribe.pm
YahooWeatherAPI.pm  11249 2016-04-16 17:03:47Z borisneubert

dev0

Your installation seems to be ok. I have an idea what the problem is. I will fix it tomorrow morning.

kroonen

#62
I also did an debug on my test fhem installation

2016.08.12 22:15:34 4: Connection accepted from WEB_192.168.180.71_6442
2016.08.12 22:15:34 4: WEB_192.168.180.71_6442 GET /fhem?cmd=setreading%20Woonkamer-Sensor%20Temperature%2021.2%3Bsetreading%20Woonkamer-Sensor%20Humidity%2079; BUFLEN:0
2016.08.12 22:15:34 5: Cmd: >setreading Woonkamer-Sensor Temperature 21.2<
2016.08.12 22:15:34 5: Cmd: >setreading Woonkamer-Sensor Humidity 79<
2016.08.12 22:15:34 4: name: /fhem?cmd=setreading%20Woonkamer-Sensor%20Temperature%2021.2%3Bsetreading%20Woonkamer-Sensor%20Humidity%2079 / RL:3294 / text/html; charset=UTF-8 /  /
2016.08.12 22:15:34 4: Connection closed for WEB_192.168.180.71_6442: EOF

I also see the issue. You take the name of the device. (mainsettings) if you have more outputs to send or more i2c device (that I have 1x bmp085 and 1 x si7021 so 2x temp 1x hum and 1 pressure), you could better take the name of the device tab and that the device name)

the setreading should look like this with %taskname%

fhem?cmd=setreading%20%tskname%%20%valname%%20%value%

regards Richard

dev0

#63
Zitat von: kroonen am 12 August 2016, 21:18:04
Undefined subroutine &main::TcpServer_Open called at ./FHEM/34_ESPEasy.pm line 806, <$fh> line 353
Should be fixed. The new version can be found on github / develop breanch.

Zitat von: kroonen am 12 August 2016, 22:23:19
you could better take the name of the device tab and that the device name)
the setreading should look like this with %taskname%
I am aware that device name is used instead of %taskname%. I consider to make it configurable in ESP GUI in the future.

Zitat von: kroonen am 12 August 2016, 21:18:04
2016.08.12 21:13:02 1: PERL WARNING: keys on reference is experimental at ./FHEM/34_ESPEasy.pm line 887, <$fh> line 353.
Do you use a perl version >= 5.20? However, you can ignore it at the momet. It is just a warning not an error. Edit: Should be fixed, too. Please test it.

Please, use code tags if you post logs, listings etc. Button with the hash sign (#).

kroonen

Hi,

All warnings are gone, and I use perl 5.2 subversion 2 default (debian debian jessie)

It should be nice to have the %taskname% in espgui than I can use it for all mij esp's (now 16 online , and 4 of them I use inputs from more that one switches.

The PWMFADE is als working, thnx for that/. Is there a way how I can make a dimmer with slider of that. the value is from 0-1000 , so i think a slider of with 0 -100% with steps of 10. Or should i do it in the ftui gui?

regards Richard




kroonen

Hi

Just another question about the new module. I have my temperature config like this

define Woonkameresp ESPEasy bridge 8383
attr Woonkameresp room Woonkamer

define Woonkamertemp ESPEasy 192.168.180.71 80 Woonkamertemp Woonkamertemp
attr Woonkamertemp IODev Woonkameresp
attr Woonkamertemp group Temperaturen
attr Woonkamertemp room Woonkamer
attr Woonkamertemp stateFormat Temp: Temperature°C Hum: Humidity

define FileLog_Woonkamertemp FileLog /var/log/fhem/Woonkamertemp-%Y.log Woonkamertemp
attr FileLog_Woonkamertemp logtype temp4hum4:Temp/Hum,text
attr FileLog_Woonkamertemp room Logfile

define weblink_Woonkamertemp SVG FileLog_Woonkamertemp:weblink_Woonkamertemp:CURRENT
attr weblink_Woonkamertemp label "Woonkamer Min $data{min1}, Max $data{max1}, Last $data{currval1}"
attr weblink_Woonkamertemp room Plots



The same esp has also a relay. Is the best way to define it than like this?


define lamp dummy
attr lamp devStateIcon on:FS20.on off:FS20.off
attr lamp eventMap on:on off:off

define relayswitchaan2 notify lamp:on set Woonkamertemp gpio 12 on

define relayswitchuit2 notify lamp:off set Woonkamertemp gpio 12 off

---------------------------------------------------------------------------------------

Or should I incoming still use the old wat on port 8083 and create for temperature / hum a dummy device, and for outgoing the module espeasy and bridge?

regards Richard

dev0

Zitat von: kroonen am 13 August 2016, 19:52:12
Or should i do it in the ftui gui?
A good idea.

Zitat von: kroonen am 13 August 2016, 21:31:24
The same esp has also a relay. Is the best way to define it than like this?


define lamp dummy
attr lamp devStateIcon on:FS20.on off:FS20.off
attr lamp eventMap on:on off:off
define relayswitchaan2 notify lamp:on set Woonkamertemp gpio 12 on
define relayswitchuit2 notify lamp:off set Woonkamertemp gpio 12 off


Or should I incoming still use the old wat on port 8083 and create for temperature / hum a dummy device, and for outgoing the module espeasy and bridge?
The old way is deprecated and can/will be removed in a future release.

You can experiment with eventMap and stateFormat to fit your needs:

attr esp eventMap /gpio 15 on:on/gpio 15 off:off/

In this example "set esp on/off" is going to switch relay on GPIO15 on/off. If you need a single device for that relay then you can use a dummy of course.

I'm serious: use "code" tags not "sup" tags. It is difficult to read on some (mobile) devices.

kroonen

I'm experimenting with PWMFADE and a slider in ftui, and it looks like to work, but I wanted to read the values, but I noticed that de PWMFADE setting not are present in the Readings. GPIO are in the reading

regards Richard

dev0

Open the pwmfade url in a browser and post the output.

kroonen

#69
Hi,

How do you mean open in the browser, what show the url be?

I think this???


192.168.180.5:8083/hem?cmd=set %Ledesp%pwmfade%1%0%1


or telnet

fhem> set Ledesp pwmfade 1 0 1
fhem> l Ledesp
Internals:
   DEF        192.168.180.30 80 H801_led H801_led
   HOST       192.168.180.30
   IDENT      H801_led
   IODev      Woonkameresp
   LASTInputDev Woonkameresp
   MSGCNT     262
   NAME       Ledesp
   NR         198
   PORT       80
   STATE      opened
   SUBTYPE    device
   TYPE       ESPEasy
   VERSION    0.2.5
   Woonkameresp_MSGCNT 262
   Woonkameresp_TIME 2016-08-15 11:10:18
   Readings:
     2016-08-14 22:16:22   GPIO1           on
     2016-08-14 22:16:22   GPIO1_mode      output
     2016-08-14 22:16:22   _lastAction     GPIO 1 Set to 1
     2016-08-15 11:10:18   presence        present
     2016-08-14 22:15:18   state           opened
   Helper:
     urlcmd     /control?cmd=
Attributes:
   IODev      Woonkameresp
   room       Woonkamer

fhem>

dev0

Use a web browser like Firefox, IE,... and type in the URL:
http://<ESP-IP>:80/control?cmd=pwmfade,<PIN>,100,1000
Replace <ESP-IP> with the IP addess of your ESP
Replace <PIN> with GPIO number

Your LEDs should do something and some data should be displayed. Show the displayed data.

kroonen


http://192.168.180.30/control?cmd=pwmfade,1,0,1


result in browser


PWM fading over 1 seconds.



It doesn't give the result that pin 1 used and value 0 and fading over 1 second




dev0

The best way to get the correct status is to ask the plugin author to send the status like sensors do.

Mick59

Hallo,
erstmal vielen Dank für die super Software, das macht die ESP Geschichte ja noch einfacher.
Hab am Wochenende mal die Entwicklerversion ausprobiert und nach Umstellen auf Port 1024 kamen auch die Readings.
Allerdings bin ich am Switch input verzweifelt es wurde einfach nichts übertragen.  Es muß wohl ein Fehler im Plugin C_009 sein.
Ich habe jetzt unter switch input die Zeilen von SENSOR_TYPE_SINGLE eingetragen:

case SENSOR_TYPE_SWITCH:
            url += F("setreading%20");
            url += Settings.Name;
            url += F("%20");
            url += ExtraTaskSettings.TaskDeviceValueNames[0];
            url += F("%20");
            url += toString(UserVar[event->BaseVarIndex],ExtraTaskSettings.TaskDeviceValueDecimals[0]);
            break;

und siehe da es funzt

Gruß
Mick

dev0

Ja, der Fehler ist mir heute morgen auch aufgefallen. Werde ich noch korrigieren, überlege aber noch das ganze auf Json umzustellen und alle verfügbaren Daten/Einstellungen zu übertragen, da wir dadurch auf Dauer unabhängiger sind.

Warum benutzt niemand mehr code tag?