I use quatanium / python-onvif to execute queries.

How can I set Filter-TopicExpression for a Subscribe request?

For the 'ConsumerReference' and 'InitialTerminationTime', I make a trace. in the following way:

subscribe.create_type('Subscribe') subscribe.Subscribe({'ConsumerReference': "http://10.1.50.11:8000", 'InitialTerminationTime': 'PT60S' }) 

Well, waiting for the filter is not clear how to do. Can you help?

    1 answer 1

    I found is a great solution:

      topic_expression_type = zeep_client.get_type('TopicExpressionType') from zeep import xsd topic_exp = xsd.Element('{http://docs.oasis-open.org/wsn/b-2}TopicExpression',xsd.ComplexType(topic_expression_type)) subscribe = notification.create_type('Subscribe') any = xsd.AnyObject(topic_exp,topic_expression_type(_value_1=xsd.AnyObject(xsd.String(), 'o2kvmd:Telemetry//.'),Dialect='http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet')) obj = subscribe(ConsumerReference='http://10.1.50.11:8000', InitialTerminationTime='PT60S', Filter={'_value_1': any}) notification.Subscribe(obj)