How to copy counter state to an other counter

I have two counters and I need to pass the value from one to the other.
I have this configuration:

[{"id":"b0349948cf9281c6","type":"tab","label":"Flow 5","disabled":false,"info":"","env":[]},{"id":"bc8c69624f016f49","type":"api-call-service","z":"b0349948cf9281c6","name":"","server":"7dfaa17084a48bae","version":5,"debugenabled":false,"domain":"counter","service":"configure","areaId":[],"deviceId":[],"entityId":["counter.aux_ac_pieza_cambio"],"data":"{\"value\": \"{{states('counter.aux_ac_pieza')|int}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":470,"y":80,"wires":[[]]},{"id":"57526d2f13565efc","type":"inject","z":"b0349948cf9281c6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":260,"y":80,"wires":[["bc8c69624f016f49"]]},{"id":"7dfaa17084a48bae","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

and I get the following error:

Call-service error. expected int for dictionary value @ data[‘value’]

5

I have search wherever.

That is a jinga template, NR uses jsonata

image

1 Like