This object is in archive! 

Rest Api Rules

Rafal shared this question 7 years ago
Need Answer

Hello,


Can you write me example of working Model Schema of POST rule with simple rule (ex. if device "1" is of then turn off device "2"). When I try to write this :

  1. {
  2. "name": "123",
  3. "code": [{
  4. "name": "123",
  5. "stopAfterExecution": false,
  6. "whenClause": {
  7. "type": "hr.chus.model.event.BinaryAttributeChangeEvent",
  8. "properties": {
  9. "clusterType": "com.zipato.cluster.Sensor",
  10. "attribute": "state",
  11. "value": true,
  12. "endpointUuid": "d7f71350-8e0e-45d7-b0e2-750c8bd35fd2",
  13. "type": "sensor"
  14. }
  15. },
  16. "elementList": [
  17. {
  18. "type": "hr.chus.model.action.generic.ArgsAction",
  19. "properties": {
  20. "clusterType": "com.zipato.cluster.OnOff",
  21. "endpointUuid": "4565f6ec-7670-4af4-a19b-14713200191d",
  22. "action": "off",
  23. "args": [],
  24. "type": "actuator"
  25. }
  26. }
  27. ]
  28. }]
  29. }

It say it's wrong but this "code-model schema" I've got from API get code rule from another rule.

Thanks for reply.

Leave a Comment
 
Attach a file