Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 1

Sonoff basic


wiesiekr

Question

Hello.

Does anyone have an idea how to make a virtual device to control Sonoff Basic with the loaded espeasy or other software so that you can switch on and off the device with the HCL.
  Is it possible to read states in the HCL or is switched on or off.

Link to comment
Share on other sites

Recommended Posts

  • 0

I have it, the problem was in the last line. Deleted -- in line  --updateStatus ()" and it works. Thank You for Your help. 

Link to comment
Share on other sites

  • 0

Ok. just re uploading..

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0

I converted this script a bit into single Sonoff 4CH or 4CH pro channels. As if someone needed to control independently as it is e.g. in double switch fibaro. Maybe it will be useful to someone.

 

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

Please login or register to see this attachment.

  • Thanks 1
Link to comment
Share on other sites

  • 0

...intersting... is Sonoff has 10x relays? :D 

 

PS: Fibaro VD UI builder - must die!

Link to comment
Share on other sites

  • 0

I haven't seen one that has 10 relays but everything in front of them ;).

 

For me, this solution works and finally works. ;D

Link to comment
Share on other sites

  • 0

 

Universal Sonoff device

 

for example 2x relays

Please login or register to see this image.

/monthly_2019_12/image.png.fdc2d893f8e8c6a7793b1f5300b0470a.png" />

 

 

for example 4x relays

 

image.png.8dc666dad45e29de5c329ff2c6b91eec.png\\

 

 

configuration

 

local model = 4 -- how many relays?

 

local iconON = 5 -- icon status ON if is any relays in ON
local iconOFF = 6 -- icon status OFF if is ALL relays in OFF
local iconERR = 1083 -- just provide error status iccon if VD can't update / rcvd status of Sonoff

 

 

NOTICE toggle button switch to ON or OFF = ALL !!! relays regardless of current status.

for example if you have  1 ON 2 OFF 2 OFF 3 ON => CLICK => 1 OFF 2 OFF 2 OFF 3 OFF

 

1 OFF 2 OFF 2 OFF 3 OFF = > 1 ON 2 ON 2 ON 3 ON

 

 

 

 

 

Please login or register to see this attachment.

Edited by 10der
  • Thanks 1
Link to comment
Share on other sites

  • 0

I wanted to get the temperature and humidity in VD and it doesn't appear on the label. Attached is a photo of the settings in the module and return with the command sent by http.

 

 

Please login or register to see this image.

/monthly_2019_12/image.png.af1f2ccba5f9d096983c34335fa2ffc5.png" />

Please login or register to see this attachment.

Please login or register to see this attachment.

Link to comment
Share on other sites

  • 0

@ptekien 2331 wymaga modyfikacji

 

Please login or register to see this code.

 

Please login or register to see this code.

=>>>>

 

Please login or register to see this code.

 

Please login or register to see this image.

/monthly_2019_12/image.png.8aa2ff99f4b1eb55d84befa07a08abeb.png" />

 

Link to comment
Share on other sites

  • 0

Unfortunately, as I changed the line in the code:
local sensors = json.decode (resp) ["StatusSNS"] ["AM2301"]

this button doesn't work at all and doesn't show the status of the inclusion :-(

Link to comment
Share on other sites

  • 0

Please login or register to see this image.

/monthly_2019_12/image.png.440b4d63e6881601bef872c7c7c04777.png" />

Link to comment
Share on other sites

  • 0

provide me clear json response from SONOFF, cuz according doc JSON should be 

 

Please login or register to see this code.

 

Link to comment
Share on other sites

  • 0

How do I enter the command:

http://192.168.1.6/cm?cmnd=status%2010

 

I receive in response:

 

{ "StatusSNS": { "Time", "2019-12-22T14: 14: 30", "AM2301": { "Temperature": 19.8, "Humidity": 54.9} "TempUnit", "C"}}

Link to comment
Share on other sites

  • 0

This is the full answer

 

{

"Status": {
"Module": 23,
"FriendlyName": [
  "Tasmota",
  "Tasmota2",
  "Tasmota3",
  "Tasmota4"
],
 
"Topic": "tasmota",
"ButtonTopic": "0",
"Power": 0,
"PowerOnState": 3,
"LedState": 1,
"LedMask": "FFFF",
"SaveData": 1,
"SaveState": 1,
"SwitchTopic": "0",
"SwitchMode": [
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0
],
 
"ButtonRetain": 0,
"SwitchRetain": 0,
"SensorRetain": 0,
"PowerRetain": 0
},
 
"StatusPRM": {
"Baudrate": 115200,
"GroupTopic": "tasmotas",
"OtaUrl": "

Please login or register to see this link.

xx
",
"RestartReason": "Power on",
"Uptime": "0T00:56:08",
"StartupUTC": "2019-12-22T12:26:32",
"Sleep": 50,
"CfgHolder": 4617,
"BootCount": 19,
"SaveCount": 146,
"SaveAddress": "FA000"
},
 
"StatusFWR": {
"Version": "7.1.1(tasmota)",
"BuildDateTime": "2019-12-01T13:18:28",
"Boot": 31,
"Core": "2_6_1",
"SDK": "2.2.2-dev(38a443e)",
"Hardware": "ESP8285"
},
 
"StatusLOG": {
"SerialLog": 2,
"WebLog": 2,
"MqttLog": 0,
"SysLog": 0,
"LogHost": "",
"LogPort": 514,
"SSId": [
  "xxx",
  ""
],
 
"TelePeriod": 300,
"Resolution": "558180C0",
"SetOption": [
  "00008009",
  "2805C8000100060000005A00000000000000",
  "00000000",
  "00000000"
],
 
},
 
"StatusMEM": {
"ProgramSize": 563,
"Free": 440,
"Heap": 26,
"ProgramFlashSize": 1024,
"FlashSize": 1024,
"FlashChipId": "144051",
"FlashMode": 255,
"Features": [
  "00000415",
  "8FDAE397",
  "043683A0",
  "22B617CD",
  "01001BC0",
  "00007881"
],
 
"Drivers": "1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,29",
"Sensors": "1,2,3,4,5,6,7,8,9,10,14,15,17,18,20,22,26,34"
},
 
"StatusNET": {
"Hostname": "xxx",
"IPAddress": "192.168.1.6",
"Gateway": "192.168.1.1",
"Subnetmask": "255.255.255.0",
"DNSServer": "192.168.1.1",
"Mac": "xxx",
"Webserver": 2,
"WifiConfig": 4
},
 
"StatusMQT": {
"MqttHost": "",
"MqttPort": 1883,
"MqttClientMask": "DVES_%06X",
"MqttClient": "DVES_48FC74",
"MqttUser": "DVES_USER",
"MqttCount": 0,
"MAX_PACKET_SIZE": 1000,
"KEEPALIVE": 30
},
 
"StatusTIM": {
"UTC": "Sun Dec 22 13:22:40 2019",
"Local": "Sun Dec 22 14:22:40 2019",
"StartDST": "Sun Mar 31 02:00:00 2019",
"EndDST": "Sun Oct 27 03:00:00 2019",
"Timezone": "+01:00",
"Sunrise": "08:41",
"Sunset": "16:56"
},
 
"StatusSNS": {
"Time": "2019-12-22T14:22:40",
"AM2301": {
"Temperature": 19.8,
"Humidity": 54.3
},
 
"TempUnit": "C"
},
 
"StatusSTS": {
"Time": "2019-12-22T14:22:40",
"Uptime": "0T00:56:08",
"UptimeSec": 3368,
"Heap": 26,
"SleepMode": "Dynamic",
"Sleep": 50,
"LoadAvg": 19,
"MqttCount": 0,
"POWER1": "OFF",
"POWER2": "OFF",
"POWER3": "OFF",
"POWER4": "OFF",
"Wifi": {
"AP": 1,
"SSId": "xxx",
"BSSId": "xxx",
"Channel": 1,
"RSSI": 94,
"LinkCount": 1,
"Downtime": "0T00:00:08"
}
 
}
 

}

Edited by ptekien
Link to comment
Share on other sites

  • 0
11 minutes ago, ptekien said:

This is the full answer

 

{

"Status": {
"Module": 23,
"FriendlyName": [
  "Tasmota",
  "Tasmota2",
  "Tasmota3",
  "Tasmota4"
],
 
"Topic": "tasmota",
"ButtonTopic": "0",
"Power": 0,
"PowerOnState": 3,
"LedState": 1,
"LedMask": "FFFF",
"SaveData": 1,
"SaveState": 1,
"SwitchTopic": "0",
"SwitchMode": [
  0,
  0,
  0,
  0,
  0,
  0,
  0,
  0
],
 
"ButtonRetain": 0,
"SwitchRetain": 0,
"SensorRetain": 0,
"PowerRetain": 0
},
 
"StatusPRM": {
"Baudrate": 115200,
"GroupTopic": "tasmotas",
"OtaUrl": "

Please login or register to see this link.

xx
",
"RestartReason": "Power on",
"Uptime": "0T00:56:08",
"StartupUTC": "2019-12-22T12:26:32",
"Sleep": 50,
"CfgHolder": 4617,
"BootCount": 19,
"SaveCount": 146,
"SaveAddress": "FA000"
},
 
"StatusFWR": {
"Version": "7.1.1(tasmota)",
"BuildDateTime": "2019-12-01T13:18:28",
"Boot": 31,
"Core": "2_6_1",
"SDK": "2.2.2-dev(38a443e)",
"Hardware": "ESP8285"
},
 
"StatusLOG": {
"SerialLog": 2,
"WebLog": 2,
"MqttLog": 0,
"SysLog": 0,
"LogHost": "",
"LogPort": 514,
"SSId": [
  "xxx",
  ""
],
 
"TelePeriod": 300,
"Resolution": "558180C0",
"SetOption": [
  "00008009",
  "2805C8000100060000005A00000000000000",
  "00000000",
  "00000000"
],
 
},
 
"StatusMEM": {
"ProgramSize": 563,
"Free": 440,
"Heap": 26,
"ProgramFlashSize": 1024,
"FlashSize": 1024,
"FlashChipId": "144051",
"FlashMode": 255,
"Features": [
  "00000415",
  "8FDAE397",
  "043683A0",
  "22B617CD",
  "01001BC0",
  "00007881"
],
 
"Drivers": "1,2,3,4,5,6,7,8,9,10,12,16,18,19,20,21,22,24,26,29",
"Sensors": "1,2,3,4,5,6,7,8,9,10,14,15,17,18,20,22,26,34"
},
 
"StatusNET": {
"Hostname": "xxx",
"IPAddress": "192.168.1.6",
"Gateway": "192.168.1.1",
"Subnetmask": "255.255.255.0",
"DNSServer": "192.168.1.1",
"Mac": "xxx",
"Webserver": 2,
"WifiConfig": 4
},
 
"StatusMQT": {
"MqttHost": "",
"MqttPort": 1883,
"MqttClientMask": "DVES_%06X",
"MqttClient": "DVES_48FC74",
"MqttUser": "DVES_USER",
"MqttCount": 0,
"MAX_PACKET_SIZE": 1000,
"KEEPALIVE": 30
},
 
"StatusTIM": {
"UTC": "Sun Dec 22 13:22:40 2019",
"Local": "Sun Dec 22 14:22:40 2019",
"StartDST": "Sun Mar 31 02:00:00 2019",
"EndDST": "Sun Oct 27 03:00:00 2019",
"Timezone": "+01:00",
"Sunrise": "08:41",
"Sunset": "16:56"
},
 
"StatusSNS": {
"Time": "2019-12-22T14:22:40",
"AM2301": {
"Temperature": 19.8,
"Humidity": 54.3
},
 
"TempUnit": "C"
},
 
"StatusSTS": {
"Time": "2019-12-22T14:22:40",
"Uptime": "0T00:56:08",
"UptimeSec": 3368,
"Heap": 26,
"SleepMode": "Dynamic",
"Sleep": 50,
"LoadAvg": 19,
"MqttCount": 0,
"POWER1": "OFF",
"POWER2": "OFF",
"POWER3": "OFF",
"POWER4": "OFF",
"Wifi": {
"AP": 1,
"SSId": "xxx",
"BSSId": "xxx",
"Channel": 1,
"RSSI": 94,
"LinkCount": 1,
"Downtime": "0T00:00:08"
}
 
}
 

}

 

Error: Parse error on line 80: ..., "00000000"], }, "StatusMEM": { -------------------^ Expecting 'STRING'

IMHO forum broke your response

Link to comment
Share on other sites

  • 0

after fixing COMMA 

 

Please login or register to see this image.

/monthly_2019_12/image.png.ed17b91ee9d998f3faa23d3f339a34df.png" />

Just now, ptekien said:

I don't understand what the problem is :-(

attach file!!! please attach file. 

 

image.png.f21a43c7e5a5dfc1dfe4d52c15ea5381.png

 

Link to comment
Share on other sites

  • 0

please attach JSON RESPONSE!

Edited by 10der
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...