Here you can find a modified Pimatic plugin for ESPEasy Mega (_C22.ino):
https://github.com/jopiekr/ESPEasyPluginPlayground.
Now it is possible to send data to 3 controllers.
-
ESPEasy Mega Pimatic plugin
-
Very nice!! Thx for letting us know!!
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebookmake it so !
-
In addition the Kaku plug-in also works very well.
https://github.com/letscontrolit/ESPEasyPluginPlayground/blob/master/_P199_RF443_KaKu.ino
I am using it only with a RXB8 receiver together with the Kaku wall switches and door sensors. With rules in ESPEasy it is possible to switch to the ESP connected relays and by means of http commands to switch directly other ESP’s or Sonoff relays. If your pimatic controller is not working in this way it is still possible to control your lights or other equipment. One of the major advantages of ESPEasy relays compared to Kaku 433 relays is that you will have a feedback about the switch state so you will know it is on or off and you can even send a boot state. -
latest espeasy-mega will not compile with _C022.ino
error: ‘CPLUGIN_PROTOCOL_ADD’ was not declared in this scope
case CPLUGIN_PROTOCOL_ADD:
error: ‘CPLUGIN_GET_DEVICENAME’ was not declared in this scope
case CPLUGIN_GET_DEVICENAME:and so on.
it compiles OK without this file.
maybe someone here to rework this file. -
If I leave _C022.ino out of the build then it compiles perfectly with all the other plugins.
but if I want to compile with _C022.ini I got all the faults and it will not compile.
I used the latest release ESPEasy mega-20210114 and the _C022.ino from the ESPEasyPluginPlayground -
I used the _C022.ino from the letscontrolit/ESPEasyPluginPlayground on github I can not find any other.
with that file it wil not compile maybe it is to old for the latest ESPEasy mega.If I look into other _C0xx files the structure is different
like this starting line,
boolean CPlugin_022(byte function, struct EventStruct *event, String& string)
or this line
case CPLUGIN_PROTOCOL_ADD:and in the latest _C002 it looks like this
bool CPlugin_002(CPlugin::Function function, struct EventStruct *event, String& string)
and this
case CPlugin::Function::CPLUGIN_PROTOCOL_ADD:I think they changed the function structure
-
It looks like the some changes happened.
What if you modify _c022.ino and- add CPlugin::Function:: to the calls and variables (like in the other files)
example: case CPLUGIN_PROTOCOL_ADD: -> case CPlugin::Function::CPLUGIN_PROTOCOL_ADD: - add Sensor_VType:: to variables starting with SENSOR_TYPE
examle: case SENSOR_TYPE_TEMP_HUM: -> case Sensor_VType::SENSOR_TYPE_TEMP_HUM:
I don’t know if this is all, but it shouldn’t be more complicated that this.
Alternative is you ask the maintainer to upgrade _022.ino - add CPlugin::Function:: to the calls and variables (like in the other files)
-
I already tried this but the biggest problem is in the second half of the file there the functions and settings are different and I don’t know how to change that.
there are also variables not declared.maybe best to try find the maintainer of the file.
/******************************************************************************* * Release notes: * V 1.0 - First version by deejaybeam, 7 July 2016 * V 1.01 - Update and rename _C009.ino to _C022.ino by Wutu due to new standard protocols, 21 September 2016 * V1.02 - Remove ">210" core statement to comply (and function) with new standard 230 core as of R114, 24 September 2016 * /******************************************************************************/ //******************************************************************************** // Pimatic updateVariable //******************************************************************************** boolean pimaticUpdateVariable(struct EventStruct *event, byte varIndex, float value, unsigned long longValue) { String authHeader = ""; if ((SecuritySettings.ControllerUser[0] != 0) && (SecuritySettings.ControllerPassword[0] != 0)) { base64 encoder; String auth = SecuritySettings.ControllerUser; auth += ":"; auth += SecuritySettings.ControllerPassword; authHeader = "Authorization: Basic " + encoder.encode(auth) + " \r\n"; } char log[80]; boolean success = false; char host[20]; sprintf_P(host, PSTR("%u.%u.%u.%u"), Settings.Controller_IP[0], Settings.Controller_IP[1], Settings.Controller_IP[2], Settings.Controller_IP[3]); sprintf_P(log, PSTR("%s%s using port %u"), "HTTP : connecting to ", host,Settings.ControllerPort); addLog(LOG_LEVEL_DEBUG, log); // Use WiFiClient class to create TCP connections WiFiClient client; if (!client.connect(host, Settings.ControllerPort)) { connectionFailures++; strcpy_P(log, PSTR("HTTP : connection failed")); addLog(LOG_LEVEL_ERROR, log); return false; } statusLED(true); if (connectionFailures) connectionFailures--; if (ExtraTaskSettings.TaskDeviceValueNames[0][0] == 0) PluginCall(PLUGIN_GET_DEVICEVALUENAMES, event, dummyString); String url = "/api/variables/"; url += URLEncode(ExtraTaskSettings.TaskDeviceValueNames[varIndex]); url.toCharArray(log, 80); addLog(LOG_LEVEL_DEBUG_MORE, log); String data; if (longValue) data = String(longValue); else data = toString(value, ExtraTaskSettings.TaskDeviceValueDecimals[varIndex]); String yourdata = "{\"type\": \"value\", \"valueOrExpression\": \"" + data + "\"}"; String hostName = host; if (Settings.UseDNS) hostName = Settings.ControllerHostName; // This will send the request to the server client.print(String("PATCH ") + url + " HTTP/1.1\r\n" + authHeader + "Host: " + hostName + "\r\n" + "Content-Type:application/json\r\n" + "Content-Length: " + yourdata.length() + "\r\n\r\n" + yourdata); unsigned long timer = millis() + 200; while (!client.available() && millis() < timer) delay(1); // Read all the lines of the reply from server and print them to Serial while (client.available()) { String line = client.readStringUntil('\n'); line.toCharArray(log, 80); addLog(LOG_LEVEL_DEBUG_MORE, log); if (line.substring(0, 15) == "HTTP/1.1 200 OK") { strcpy_P(log, PSTR("HTTP : Succes!")); addLog(LOG_LEVEL_DEBUG, log); success = true; } delay(1); } strcpy_P(log, PSTR("HTTP : closing connection")); addLog(LOG_LEVEL_DEBUG, log); client.flush(); client.stop(); }