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


Question

Posted

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.

Recommended Posts

  • 0
Posted

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

  • 0
Posted

Ok. just re uploading..

Please login or register to see this attachment.

  • 0
Posted

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
  • 0
Posted

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

 

PS: Fibaro VD UI builder - must die!

  • 0
Posted

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

 

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

  • 0
Posted (edited)

 

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
  • 0
Posted

Very good idea. Congratulations.

  • 0
Posted

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.

  • 0
Posted

@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" />

 

  • 0
Posted

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 :-(

  • 0
Posted

Please login or register to see this image.

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

  • 0
Posted

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

 

Please login or register to see this code.

 

  • 0
Posted

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"}}

  • 0
Posted (edited)

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
  • 0
Posted
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

  • 0
Posted

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

  • 0
Posted

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

 

  • 0
Posted

Please login or register to see this attachment.

  • 0
Posted (edited)

please attach JSON RESPONSE!

Edited by 10der
  • 0
Posted

Please login or register to see this attachment.

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...