Not understanding why CentralScene::HandleMsg prints "No ValueID created for Scene %d"

5 views
Skip to first unread message

Igor Lumpus

unread,
Aug 12, 2021, 12:58:50 AMAug 12
to OpenZWave
Hi,
I am using OpenZwave from python, the OpenZWave/python-openzwave repo.
My very simple app is run on an Raspberry Pi3 with an RaZberry Hat and the ZWave network is up and messages are captured by the RaZberry controller.
You should understand that I am a totally newbie on the ZWave concept.

However I must be missing something with the concept since when pressing the FIBARO button I get this in the console (where the first row is after  ZWave has been initialized with no asserts and second row is first print of button level since I initialized self.last_level to 1 to at least get one print of read value):
   Waiting for key presses   
   Button level is: 0   
   2021-08-10 11:43:21.293 Detail, Node002,   Received: 0x01, 0x0d, 0x00, 0x04, 0x00, 0x02, 0x05, 0x5b, 0x03, 0x18, 0x80, 0x01, 0x7e, 0x00, 0x4e  
   2021-08-10 11:43:21.294 Detail,    
   2021-08-10 11:43:21.294 Info, Node002, Received Central Scene set from node 2: scene id=1 in 7680 seconds. Sending event notification.   
   2021-08-10 11:43:21.294 Warning, Node002, No ValueID created for Scene 1   

So in the console output above one can see that the FIBARO button was pressed (Node002) but level from the get_dimmer_levelfunction always returns 0 and this might be correlated to that  in CentralScene::HandleMsg the statement:
      if (Internal::VC::ValueList* value = static_cast<Internal::VC::ValueList*>(GetValue(_instance, sceneID)))   
fails and executes the:
       Log::Write(LogLevel_Warning, GetNodeId(), "No ValueID created for Scene %d", sceneID);
instead
    
Below is part of the app that is ivolved with my problem of not getting values from the FIBARO button

class application():
    def __init__(self):
        self.last_level = 1

    def check_entry_button(self):
        node, val_id = self.get_node_id('button')
        level = self.network.nodes[node].get_dimmer_level(val_id)
        if not self.keep_blinking and self.last_level != level:
            print(f'Button level is: {level}')
        self.last_level = level
        return level > 0

    def init_zwave(self):
        #Create a network object
        device = '/dev/ttyUSB20'
        log = 'Debug'
        options = ZWaveOption(device, config_path= '../open-zwave/config')
        options.set_log_file("OZW_Log.log")
        options.set_append_log_file(False)
        options.set_console_output(True)
        options.set_save_log_level(log)
        #options.set_save_log_level('Info')
        options.set_logging(False)
        options.lock()
        self.network = ZWaveNetwork(options, log=None)
        self.network.start()
        for i in range(0,self.zwave_wait):
            if self.network.state >= self.network.STATE_AWAKED:
                break
            else:
                time.sleep(self.zwave_sleep)
        if self.network.state < self.network.STATE_AWAKED:
            print('Network not awake !! Continue and check what happens')
        for i in range(0,self.zwave_wait):
            if self.network.state >= self.network.STATE_READY:
                break
            else:
                time.sleep(self.zwave_sleep)
        if not self.network.is_ready:
            print('Network not ready !! Continue and check what happens')
        else:
            print('Network started')
        # Store ids for FIBARO button and Teldus switch for quick access into the nodes array
        self.zwave = {}
        for node in self.network.nodes:
            if self.network.nodes[node].product_id == '0x1000':
                for val in self.network.nodes[node].get_dimmers():
                    self.zwave['button'] = {'node': node, 'val_id': val}
            elif self.network.nodes[node].product_id == '0x0003':
                for val in self.network.nodes[node].get_switches():
                    self.zwave['outlet'] = {'node': node, 'val_id': val}
        # Assert we have both button and outlet connected
        assert 'button' in self.zwave, 'External Fibaro button did not connect'
        assert 'outlet' in self.zwave, 'Teldus pwer outlet did not connect'
 
def main():
    print('Starting app')
    app = application()
    app.init_zwave()
    print('Waiting for key presses')
    run_application = True
    prev_state = False
    while run_application:
        if app.keep_blinking:
            app.toggle_lamp()
            # Check if it can be turned off
            app.check_lamp_off()
        if app.check_entry_button():
            # Activate blinkning lamp
            app.start_blinking()
        run_application = not app.stop


Reply all
Reply to author
Forward
0 new messages