I assume you use the Phoscon software to add devices.
You can see in Phoscon the state and if a device is reachable/online.
Could you check what happen with the reachability, when the switch is in the wall-outlet and then pulled out. The same with a light.
The info in the phoscon app is also what is used in Pimatic.
-
Release pimatic-raspbee@0.1.6
-
@ed-vrijmoet said in Release pimatic-raspbee@0.1.6:
no the behavior is not new it was there before the update
and yes the attribute is there only not reflected in the GUIYou mean the attribute presence value differs from the gui dot?
-
this is the switch
debug [pimatic-raspbee]: { e: ‘changed’,
id: ‘4’,
r: ‘lights’,
state: { on: false, reachable: false },
t: ‘event’,
uniqueid: ‘048c:df:3c:7b:1b:bb-01’ }this is the light bulb
debug [pimatic-raspbee]: { e: ‘changed’,
id: ‘3’,
r: ‘lights’,
state:
{ alert: null,
bri: 255,
colormode: ‘ct’,
ct: 153,
effect: ‘none’,
hue: 0,
on: true,
reachable: false,
sat: 254,
xy: [ 0.7, 0.3 ] },
t: ‘event’,
uniqueid: ‘58:8e:81:ff:fe:f0:8c:64-01’ }and yes I mean the attribute presence value differs from the gui dot
-
yes both dot’s are off
when inserting the plug the dot still is off even as reachable is true
when i switch on the light the dot is ondebug [pimatic-raspbee]: { e: ‘changed’,
id: ‘4’,
r: ‘lights’,
state: { on: true, reachable: true },
t: ‘event’,
uniqueid: ‘048c:df:3c:7b:1b:bb-01’ }debug [pimatic-raspbee]: { e: ‘changed’,
id: ‘3’,
r: ‘lights’,
state:
{ alert: null,
bri: 254,
colormode: ‘ct’,
ct: 153,
effect: ‘none’,
hue: 0,
on: true,
reachable: true,
sat: 254,
xy: [ 0.7, 0.3 ] },
t: ‘event’,
uniqueid: ‘58:8e:81:ff:fe:f0:8c:64-01’ } -
nothing changes after page refresh
only the dots for the lights change to on the dot for the switch is still off -
Thank You
-
I did a reachable test with an IKEA outlet. Its a RaspBeeSwitch device.
After unplugging it takes some time (5-10 mn) before the Zigbee network discovers that the outlet is not reachable. But when thats detected the dot goes to ‘off’. When I plug the outlet back in, the dot switches almost directly to 'on’
So it works in my testcase. -
I did change all 3 files including raspbee-template.coffee with your files but it is still the same
this looks OK but my other plug wich still is plugged in
in the field power smart plug it reflects the current status but not in the field smart plug the dot still is offline while the plug is online -
no never
-
Is it an option for you to replace the dot with the online/offline text? (like the sensor). The difference is you don’t need to change the gui files that could cause the issue.
Below the replacement for RaspBeeSwitch class that will do that trick. I left the presence code in (commented)
class RaspBeeSwitch extends env.devices.PowerSwitch #template: "raspbee-switch" constructor: (@config,lastState) -> @id = @config.id @name = @config.name @deviceID = @config.deviceID #@_presence = lastState?.presence?.value or false @_online = lastState?.online?.value or false @_state = lastState?.state?.value or off @attributes.online = { description: "Online status", type: "boolean" labels: ['online', 'offline'] } ### @addAttribute 'presence', description: "online status", type: t.boolean, label: 'reachable' ### super() myRaspBeePlugin.on "event", (data) => if data.resource is "lights" and data.id is @deviceID and data.event is "changed" @parseEvent(data) @getInfos() myRaspBeePlugin.on "ready", () => @getInfos() getInfos: -> if (myRaspBeePlugin.ready) myRaspBeePlugin.Connector.getLight(@deviceID).then( (res) => @parseEvent(res) ).catch( (error) => env.logger.error (error) ) parseEvent: (data) -> #@_setPresence(data.state.reachable) if data.state?.reachable? @_setOnline(data.state.reachable) if data.state?.reachable? @_setState(data.state.on) destroy: -> super() #getTemplateName: -> "raspbee-switch" ### _setPresence: (value) -> if @_presence is value then return @_presence = value @emit 'presence', value ### _setOnline: (value) -> if @_online is value then return @_online = value @emit 'online', value #getPresence: -> Promise.resolve(@_presence) getOnline: -> Promise.resolve(@_online) changeStateTo: (state) -> @_sendState({on: state}).then( () => return Promise.resolve() ).catch( (error) => env.logger.error error return Promise.reject(error) ) _sendState: (param) -> if (myRaspBeePlugin.ready) myRaspBeePlugin.Connector.setLightState(@deviceID,param).then( (res) => env.logger.debug ("New value send to device #{@name}") env.logger.debug (param) if res[0].success? return Promise.resolve() else if (res[0].error.type is 3 ) @_setPresence(false) return Promise.reject(Error("device #{@name} not reachable")) else if (res[0].error.type is 201 ) return Promise.reject(Error("device #{@name} is not modifiable. Device is set to off")) ).catch( (error) => return Promise.reject(error) ) else env.logger.error("gateway not online") return Promise.reject(Error("gateway not online"))
-
The smart plug is a Xiaomi Mi model ZNCZ04LM i don’t know what Class
In witch file should i paste the replacement text and on witch line
-
I ment the pimatic class. You can see it when you click on the device name
You should replace the RaspBeeSwitch class in the file raspbee.coffee (starting around line 918, but look for the first line)
class RaspBeeSwitch extends env.devices.PowerSwitch
-
class is RaspBeeSwitch