weixin_39989862
weixin_39989862
2020-12-09 15:04

newScenario : issue with evaluate for a sensor used several time in a scenario

When a sensor is used several time in a scenario, for example in the IF and then in an action, the actions are done twice.

Screenshot : http://snag.gy/hTs0M.jpg

Json and code generated :


2016-03-23 22:59:16,062 domogik-scenario INFO Create or save scenario : name = '57', id = '57', json = '{"type":"controls_if","id":"CXeRaH*|O;%(XRY0~0(d","IF0":{"type":"logic_compare","id":"0hvmX+N5b=h}6jU.c:5f","OP":"EQ","A":{"type":"sensor.SensorTest.325","id":"ra|v1|5:EU)n~-vG5NPh","usage.usage":"value"},"B":{"type":"DT_Bool","id":"2r16[h)TW,","BOOL":"1"}},"DO0":{"type":"log.LogAction","id":"4Uo((2;;O!/i-mqMU#.|","message":{"type":"text","id":"af2CI=5~xp6[J#zHBwcB","TEXT":"C EST VRAI"},"NEXT":{"type":"log.LogAction","id":"_mz/esE{AW8MFCe05u0r","message":{"type":"text_join","id":"GQaWq,Vsp37JK{TVz9F4","ADD0":{"type":"text","id":"K;qb5*aaaQi|dW|Ir4~y","TEXT":"C EST TOUJOURS VRAI"},"ADD1":{"type":"sensor.SensorTest.325","id":"+;s;G1U}h(dG#[QXO5;S","usage.usage":"value"},"itemCount":2}}}}'
....
2016-03-23 22:59:16,157 domogik-scenario.Test evaluate DEBUG Scenario 'Test evaluate' python generated code : 
if ( self._mapping['test']['46df1927-0a0b-44ed-8c9e-d8b0756e89fd'].evaluate() == True ):
    self._mapping['action']['0-c8bac125-8ffa-465a-ba55-f6d6ed877154'].set_param("message", ("C EST VRAI"))
    self._mapping['action']['0-c8bac125-8ffa-465a-ba55-f6d6ed877154'].do_action()
    self._mapping['action']['1-1f977e87-6452-4ee2-a965-23b51b37d513'].set_param("message", (str("C EST TOUJOURS VRAI") + str(self._mapping['test']['fafe02b9-9812-47fd-9ee7-1829a6a96f6a'].evaluate())))
    self._mapping['action']['1-1f977e87-6452-4ee2-a965-23b51b37d513'].do_action()

Log when scenario is triggered :


016-03-23 22:57:09,905 domogik-scenario.Test evaluate DEBUG Evaluate SensorTest '325' in mode 'value' to 'True'. Type is '<type>'
2016-03-23 22:57:09,905 domogik-scenario.Test evaluate INFO C EST VRAI
2016-03-23 22:57:09,905 domogik-scenario.Test evaluate DEBUG Evaluate SensorTest '325' in mode 'value' to 'True'. Type is '<type>'
2016-03-23 22:57:09,906 domogik-scenario.Test evaluate INFO C EST TOUJOURS VRAITrue
2016-03-23 22:57:09,908 domogik-scenario.Test evaluate DEBUG Evaluate SensorTest '325' in mode 'value' to 'True'. Type is '<type>'
2016-03-23 22:57:09,909 domogik-scenario.Test evaluate INFO C EST VRAI
2016-03-23 22:57:09,909 domogik-scenario.Test evaluate DEBUG Evaluate SensorTest '325' in mode 'value' to 'True'. Type is '<type>'
2016-03-23 22:57:09,916 domogik-scenario.Test evaluate INFO C EST TOUJOURS VRAITrue
2016-03-23 22:57:09,938 domogik-scenario DEBUG Send client status : alive
</type></type></type></type>

该提问来源于开源项目:domogik/domogik

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

13条回答

  • weixin_39989862 weixin_39989862 5月前

    I think that the issue is that when we read a sensor, we do evaluate() and when we do evaluate, we test a scenario to raise it.... We should find a way to get the current sensor value without raising the scenario if we are out of a test...

    点赞 评论 复制链接分享
  • weixin_39793708 weixin_39793708 5月前

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie notifications.com wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200735895

    点赞 评论 复制链接分享
  • weixin_39793708 weixin_39793708 5月前

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if ( self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() == True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message", ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message", (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie notifications.com wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200735895

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie notifications.com wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if ( self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() == True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message", ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message", (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie notifications.com wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200735895

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    点赞 评论 复制链接分享
  • weixin_39793708 weixin_39793708 5月前

    i know about those and i'm testing a fix for it

    On Thu, Mar 24, 2016 at 10:45 AM, Fritz SMH notifications.com wrote:

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie notifications.com wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if (

    self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate()

    True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message", ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message", (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie < notifications.com> wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200735895>

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200758843

    点赞 评论 复制链接分享
  • weixin_39793708 weixin_39793708 5月前

    and yes i'm using a value

    [image: Inline image 1]

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie maikel.punie.com wrote:

    i know about those and i'm testing a fix for it

    On Thu, Mar 24, 2016 at 10:45 AM, Fritz SMH notifications.com wrote:

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie notifications.com wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if (

    self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() == True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message", ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message", (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie < notifications.com> wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200735895>

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub <https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200758843

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    The number of time a if is executed is related to the number of time the sensor is used in the scenario...

    Result of the execution :

    
    ---- Before execution of the if ----
    2016-03-24 09:58:17,987 domogik-scenario.Test bin 2 DEBUG Evaluate
    SensorTest '43' in mode 'value' to 'False'. Type is '<type>'
    2016-03-24 09:58:17,987 domogik-scenario.Test bin 2 INFO C EST FAUX
    ---- Before execution of the if ----
    2016-03-24 09:58:17,988 domogik-scenario.Test bin 2 DEBUG Evaluate
    SensorTest '43' in mode 'value' to 'False'. Type is '<type>'
    2016-03-24 09:58:17,988 domogik-scenario.Test bin 2 INFO C EST FAUX
    ---- Before execution of the if ----
    2016-03-24 09:58:17,988 domogik-scenario.Test bin 2 DEBUG Evaluate
    SensorTest '43' in mode 'value' to 'False'. Type is '<type>'
    2016-03-24 09:58:17,988 domogik-scenario.Test bin 2 INFO C EST FAUX
    ---- Before execution of the if ----
    2016-03-24 09:58:17,988 domogik-scenario.Test bin 2 DEBUG Evaluate
    SensorTest '43' in mode 'value' to 'False'. Type is '<type>'
    2016-03-24 09:58:17,989 domogik-scenario.Test bin 2 INFO C EST FAUX
    2016-03-24 09:58:19,414 domogik-scenario DEBUG Send client status : alive
    </type></type></type></type>

    Python generated code (I tuned to add the print) :

    
    2016-03-24 09:58:07,355 domogik-scenario.Test bin 2 DEBUG Scenario 'Test
    bin 2' python generated code :
    print('---- Before execution of the if ----')
    if ( (
    self._mapping['test']['ca5625be-d165-466c-a597-06b4f2ab7422'].evaluate() ==
    True ) and (
    self._mapping['test']['a584a2a9-040f-4589-a747-054d968fe9c4'].evaluate() ==
    True ) ):
    
    self._mapping['action']['0-cbdcd542-7a67-4e21-b3d5-84de24511a30'].set_param("message",
    (str("C EST VRAI. Valeur = ") +
    str(self._mapping['test']['be972c45-16ed-461f-9507-1bfaa57fb220'].evaluate())
    +
    str(self._mapping['test']['2e3ce0b9-fe2a-438c-a449-ff93c60eca63'].evaluate())))
    
    self._mapping['action']['0-cbdcd542-7a67-4e21-b3d5-84de24511a30'].do_action()
    else:
    
    self._mapping['action']['1-b3f1b526-488e-47b3-b5a3-07d63eb034fb'].set_param("message",
    ("C EST FAUX"))
    
    self._mapping['action']['1-b3f1b526-488e-47b3-b5a3-07d63eb034fb'].do_action()
    
    

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie notifications.com wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if ( self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() == True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message", ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message", (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie notifications.com wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200735895

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    It is the function "eval_condition()" which is called N times for N sensors

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie notifications.com wrote:

    and yes i'm using a value

    [image: Inline image 1]

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie maikel.punie.com wrote:

    i know about those and i'm testing a fix for it

    On Thu, Mar 24, 2016 at 10:45 AM, Fritz SMH notifications.com wrote:

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie < notifications.com> wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if (

    self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() ==

    True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message",

    ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message",

    (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie < notifications.com> wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200735895>

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub <https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200758843

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200765414

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    I think I understand the issue.

    In a sensorTest (and the other tests) we start the code like this :

    class AbstractSensorTest(AbstractTest, MQAsyncSub): def init(self, log = None, trigger = None, cond = None, params = None): AbstractTest.init(self, log, trigger, cond, params)

    And when we get a MQ message (a value) , we do :

    
    def handle_message(self, did, msg):
        self._res = self._convert(msg['stored_value'])
        self._trigger(self)
    

    In scenario.py, the function _create_instance() is called for each sensor block found in the scenario, and in this function, this is done :

    
            module_name = "domogik.scenario.tests.{0}".format(mod)
            cobj = getattr(__import__(module_name, fromlist=[mod]), clas)
            self._log.debug(u"Create test instance {0} with uuid
    

    {1}".format(inst, uuid)) obj = cobj(log=self._log, trigger=self.generic_trigger, cond=self, params=param) module_name = "domogik.scenario.tests.{0}".format(mod) cobj = getattr(import(module_name, fromlist=[mod]), clas) self._log.debug(u"Create test instance {0} with uuid {1}".format(inst, uuid)) obj = cobj(log=self._log, trigger=self.generic_trigger, cond=self, params=param)

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie notifications.com wrote:

    and yes i'm using a value

    [image: Inline image 1]

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie maikel.punie.com wrote:

    i know about those and i'm testing a fix for it

    On Thu, Mar 24, 2016 at 10:45 AM, Fritz SMH notifications.com wrote:

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie < notifications.com> wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if (

    self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() ==

    True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message",

    ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message",

    (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie < notifications.com> wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200735895>

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub <https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200758843

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200765414

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    crap, sended before finishing :)

    So the generic_trigger() function will be called for each sensor when a new value is received, so the eval_condition() function (called by generic_trigger()) will be executed N times if the related sensor is used N time in the scenario.

    We should find a way to trigger only one time if a sensor is used several times.

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie notifications.com wrote:

    and yes i'm using a value

    [image: Inline image 1]

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie maikel.punie.com wrote:

    i know about those and i'm testing a fix for it

    On Thu, Mar 24, 2016 at 10:45 AM, Fritz SMH notifications.com wrote:

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie < notifications.com> wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if (

    self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() ==

    True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message",

    ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message",

    (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie < notifications.com> wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200735895>

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub <https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200758843

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200765414

    点赞 评论 复制链接分享
  • weixin_39989862 weixin_39989862 5月前

    I have a fix on my local repo :) I will do some more tests before pushing

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie notifications.com wrote:

    and yes i'm using a value

    [image: Inline image 1]

    On Thu, Mar 24, 2016 at 10:57 AM, Maikel Punie maikel.punie.com wrote:

    i know about those and i'm testing a fix for it

    On Thu, Mar 24, 2016 at 10:45 AM, Fritz SMH notifications.com wrote:

    It seems you didn't use the sensor value in the log message.

    I often see errors like this in the logs :

    ... File "/opt/dmg/domogik-mq/src/domogikmq/pubsub/subscriber.py", line 126, in _on_message self.on_message(mid, jsons) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 68, in on_message self.handle_message(did, msg) File "/opt/dmg/domogik/src/domogik/scenario/tests/sensor.py", line 85, in handle_message self._trigger(self) File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 398, in generic_trigger self.eval_condition() File "/opt/dmg/domogik/src/domogik/scenario/scenario.py", line 350, in eval_condition exec(self._compiled_condition) File "Scenario Test bin 2", line 1, in KeyError: 'fdadc727-03a0-4fdc-be53-960f05f76ddb'

    Any idea ?

    On Thu, Mar 24, 2016 at 10:40 AM, Maikel Punie < notifications.com> wrote:

    even then i can not reproduce it ....

    2016-03-24 10:38:54,002 domogik-scenario.test DEBUG Scenario 'test' python generated code : if (

    self._mapping['test']['31ddab8c-6cf4-4ba0-af5b-951a11f5483a'].evaluate() ==

    True ):

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].set_param("message",

    ("========================================="))

    self._mapping['action']['0-1d517587-a082-4618-a606-a2b60b5833bb'].do_action()

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].set_param("message",

    (str("+++++++++++") + str("*****")))

    self._mapping['action']['1-67f3d078-dd7f-40bc-a363-5b096725c756'].do_action()

    2016-03-24 10:38:54,003 domogik-scenario DEBUG Create scenario instance test with payload {u'IF0': {u'A': {u'type': u'sensor.SensorTest.297', u'id': u'-jqnldIXoGCRaxmzqDQf', u'usage.usage': u'value'}, u'B': {u'BOOL': u'TRUE', u'type': u'logic_boolean', u'id': u']p~Y,1:2bJm3zhxtNQ;'}, u'type': u'logic_compare', u'id': u'k#|qtuhT:_FSC]q#6rk)', u'OP': u'EQ'}, u'DO0': {u'message': {u'TEXT': u'=========================================', u'type': u'text', u'id': u'A+j!vmI3y|NFy!~3A0lc'}, u'type': u'log.LogAction', u'id': u'^R1b}(wlZDng+PAcvp.9', u'NEXT': {u'message': {u'itemCount': 2, u'type': u'text_join', u'id': u'cBHt``WI)e?Q|+1W0?ac', u'ADD1': {u'TEXT': u'***', u'type': u'text', u'id': u'M3!)|K97)N:{)QpKY]m!'}, u'ADD0': {u'TEXT': u'+++++++++++', u'type': u'text', u'id': u'g!#ha89ag7!qijv-.[Ak'}}, u'type': u'log.LogAction', u'id': u')/q@-7p:UyJOT.jg,GT8'}}, u'type': u'controls_if', u'id': u'CXeRaH|O;%(XRY0~0(d'} (None, None, None) 2016-03-24 10:38:54,003 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'False'. Type is '' 2016-03-24 10:38:54,004 domogik-scenario INFO Scenario Frontend and Manager initialized, let's wait for some work. 2016-03-24 10:38:54,004 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:38:54,004 domogik-scenario INFO Start IOLoop for MQ : nothing else can be executed in the init after this! Make sure that the self.ready() call is the last line of your init!!!! 2016-03-24 10:39:08,919 domogik-scenario DEBUG Send client status : alive 2016-03-24 10:39:13,401 domogik-scenario.test DEBUG Evaluate SensorTest '297' in mode 'value' to 'True'. Type is ''

    2016-03-24 10:39:13,401 domogik-scenario.test INFO

    2016-03-24 10:39:13,401 domogik-scenario.test INFO +++++++++++*****

    On Thu, Mar 24, 2016 at 9:46 AM, Fritz SMH notifications.com wrote:

    The domogik-plugin-vdevice (from domos) is very usefull for this :) Just create a binary vdevice and from admin you can click on the on/off buttons of the command to simulate a real device

    On Thu, Mar 24, 2016 at 9:39 AM, Maikel Punie < notifications.com> wrote:

    hmm, this only happens to bool sensors ....

    i can not reproduce it with a dt_number sensor

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200735895>

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub < https://github.com/domogik/domogik/issues/279#issuecomment-200738355

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub <https://github.com/domogik/domogik/issues/279#issuecomment-200756978

    — You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200758843

    — You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/domogik/domogik/issues/279#issuecomment-200765414

    点赞 评论 复制链接分享
  • weixin_39793708 weixin_39793708 5月前

    solved in the newScenario branch

    点赞 评论 复制链接分享

相关推荐